Package Cn.zzsxt.boke;
Import Java.util.Scanner; ---------------------->//This place is a guide package
public class Boke1 {
public static void Main (string[] args) {
Scanner input = new Scanner (system.in);
System.out.println ("Please enter your name:");
String Name=input.next ();----------------->//This place is to assign values to variables
System.out.println ("Please enter your Age:");
int Age=input.nextint ();
System.out.println ("Please enter your gender:");
String Sex=input.next ();
System.out.println ("Your Name:" +name);
System.out.println ("Your Age:" +age);
SYSTEM.OUT.PRINTLN ("Your Gender:" +sex);
}
}
In Java, you want to declare a variable required pilot package.
Declaring a variable to be of a type;
Type: byte short int long Flaot double Boolean
You assign the value to be consistent with the declared variable type.
How to declare variables and assignments in Java