package com.atstudy;
import java.util.Scanner; //导入Scanner
public class ScannerDemo {
public static void main(String[] args) {
Scanner sc=new Scanner(System.in);
//要求用户输入姓名,年龄,职务
System.out.print("请输入姓名:");
String name=sc.nextLine();
System.out.print("请输入年龄:");
String age=sc.nextLine();
System.out.print("请输入职务:");
String job=sc.nextLine();
//在控制台输出结果: 姓名:xx 年龄:xx 职务:xx
System.out.println("name:"+name+";age:"+age+";job:"+job);
sc.close();//释放资源
}
}