Sololearn: Learn to Code
New course! Every coder should learn Generative AI!
Try a free lesson
0
The Java.io.BufferedReader class reads text from a character-input stream, buffering characters so as to provide for the efficient reading of characters, arrays, and lines. First import the java.io.* class. Next Create a reference variable(br). BufferedReader br = new BufferedReader(new InputStreamReader(System.in)); now use ReadLine() method with br(br.ReadLine()). You may also have to include a try catch statement with it. It's simple to use the Scanner class though.
12th Jul 2016, 9:57 AM
Ashwani Jha
Ashwani Jha - avatar