If you look at the API of the read(char[] buf) method of the InputStreamReader class, you will see that we get -1 if we reach the end the stream (or the end of the file in our case).
arulk pillai wrote:I have blogged some questions and answers at 400+ Java Interview Questions and Answers
Also, try googling for: java interview questions
arulk pillai wrote:-- Brush on the core Java and enterprise Java fundamentals
Bear Bibeault wrote:Firstly, please read KeepItDown and refrain from posting in all uppercase. I have adjusted the topic title for you.
Secondly, cramming for an interview is unlikely to help. You either know your stuff or you don't.