对,其实并没有System.in.readLine()这个方法,所以你的程序执行不了,如果要夺取多个字符的话,你可以用read()的变体: read(byte[] b) ; Reads some number of bytes from the input stream and stores them into the buffer array b.read(byte[] b, int off, int len) ; Reads up to len bytes of data from the input stream into an array of bytes.
InputStreamReader input = new InputStreamReader(System.in); BufferedReader read = BufferedReader(input); read.readLine();//This is the corret method for your question not System.in.readLine();
这似乎不存在吧.
read(byte[] b) ;
Reads some number of bytes from the input stream and stores them into the buffer array b.read(byte[] b, int off, int len) ;
Reads up to len bytes of data from the input stream into an array of bytes.
BufferedReader read = BufferedReader(input);
read.readLine();//This is the corret method for your question
not System.in.readLine();
BufferedReader br=new BufferedReader(new InputStreamReader(System.in));