📜  用户输入(扫描仪) - Java 代码示例

📅  最后修改于: 2022-03-11 14:52:47.192000             🧑  作者: Mango

代码示例2
Scanner scanner = new Scanner(System.in);

System.out.println("What's your name?");
String name = scanner.nextLine();

System.out.println("What's your year of birth?");
int yearOfBirth = scanner.nextInt();