The readLine() method of Console class in Java is used to read a single line of text from the console. Syntax: public String readLine() Parameters: This method does not accept any parameter. Return value: This method returns the string containing the line that is read from the console.
What is readLine method?
The readline method reads one line from the file and returns it as a string. The string returned by readline will contain the newline character at the end. This method returns the empty string when it reaches the end of the file.
What is BufferedReader in Java?
public class BufferedReader extends Reader. Reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines.