by Dinesh Thakur Category: Stream

To read a character form the Buffered Reader object, use the following version of read() method. int read( ) throws IOException

The method read() will return a integer value corresponding the character from the input stream and if end of the stream come across then it will return -1.


Example: To read characters.



class CharacterRead


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


char ch;

BufferedReader brObj = new BufferedReader(new InputStreamReader(;

System.out.println("Enter characters, 'Q' to quit.");



ch = (char);


} while(ch != 'Q');






Character Reader

Popular Article