difference between read () and readLine () method? | SoloLearn: Learn to code for FREE!

+2

difference between read () and readLine () method?

8/5/2016 8:22:03 PM

sachin tomar

1 Answer

New Answer

+3

/* read() method reads single character and return the character it read */ System.out.println("read() reads character " + bufferedReader.read()); /* readLine() reads line till it sees \n, \r or \r\n, also since read() method already read 1 character, then readLine starts reading at second character*/ System.out.println("readLine() result is: " + bufferedReader.readLine());