How to take input using BufferedReader in Java?

Java

Can someone explain me the method of taking input by using BufferedReader in Java?


If you want to unleash your potential in this competitive field, please visit the Java course page for more information, where you can find the Java tutorials and Java frequently asked interview questions and answers as well.

1
Answers

Replies

BufferedReader is a method that is used to decrease the time for taking the input values. The scanner class is used over here. 


Below is the representation: 



BufferedReader inp = new BufferedReader (new InputStreamReader(System.in));


int T= Integer.parseInt(inp.readLine()); // To take the number as an input 


String str = inp.readLine(); // To take the string as an input 

 
 

This topic has been locked/unapproved. No replies allowed

Login to participate in this discussion.

Leave a reply

Before proceeding, please check your email for a verification link. If you did not receive the email, click here to request another.
WhatsApp
To Top