----------------------------------------------------------------------------------------------------------------
读入一个字节
char i = (char) System.in.read();
----------------------------------------------------------------------------------------------------------------
读入一行字符
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
str = br.readLine();
----------------------------------------------------------------------------------------------------------------
读入指定长度字节
byte[] arr = new byte[10];
int a = System.in.read(arr);
----------------------------------------------------------------------------------------------------------------
Scanner输入
Scanner s = new Scanner(System.in);
int i = s.nextInt();
next.Byte(),nextDouble(),nextFloat,nextInt(),nextLine(),nextLong(),nextShot()
上述方法执行时都会造成堵塞,等待用户在命令行输入数据回车确认。
例如需要输入两个数100和99,它们之间用空格隔开,则在程序中则需要调用两次nextInt()
----------------------------------------------------------------------------------------------------------------
还有些别的大同小异的方法,仅提供一种思路,具体还要查API文档