by Dinesh Thakur Category: Stream

To read a string form the Buffered Reader object, use the following version of readLine() method.

                           String readLine( ) throws IOException





class StringRead


public static void main(String args[]) throws IOException


BufferedReader brObj = new BufferedReader(new InputStreamReader(;

String strObj;

System.out.println("Enter lines of string ['exit to quit']");



strObj = brObj.readLine();


} while(!strObj.equals("exit"));





Reading String

About Dinesh Thakur

Dinesh ThakurDinesh Thakur holds an B.C.A, MCSE, MCDBA, CCNA, CCNP, A+, SCJP certifications. Dinesh authors the hugely popular blog. Where he writes how-to guides around Computer fundamental , computer software, Computer programming, and web apps. For any type of query or something that you think is missing, please feel free to Contact us.

Related Articles