1、输入的类Scanner在包java.util内
需要先导入里面该包的Scanner类
import java.util.Scanner
2、新建一个Scanner类的对象
Scanner in = new Scanner(System.in);
3、接受输入内容
String a = in.next();
int a = in.nextInt();
long a = in.nextLong();
float a = in.nextFloat();
byte a = in.nextByte();
boolean a = in.nextB
//字符char无nextChar
char c = a.charAt(0);