通过scanner进行输入
Scanner in = new Scanner(System.in);
String name = in.next();
通过Scanner进行一个简单输入
public static void main(String[] args) {
Scanner inScanner = new Scanner(System.in);
System.out.println("what is your name?");
String name = inScanner.nextLine();
Scanner inage = new Scanner(System.in);
System.out.println("what is age?");
int age = inage.nextInt();
System.out.println(age + name);
}