八种基本数据类型和字符串类型
package TX;
import java.util.Scanner;
public class Input {
public static void main(String[] args) {
Scanner input = new Scanner(System.in);
//七种基本数据类型
int i = input.nextInt();
byte b = input.nextByte();
Double d = input.nextDouble();
Float f = input.nextFloat();
short s = input.nextShort();
long l = input.nextLong();
boolean bo = input.nextBoolean();
//字符串类型
String string = input.nextLine();
//字符类型的获取不能直接得到,通过字符串获得
String chString = input.nextLine();
char ch = chString.charAt(0);
}
}