output File is written
Data is 84
read() of FileReader class , returns int value but at line 3 it seems that it returns array of integers as i apply while loop on it.I dont understand output "Data is 84 " from line 2 . how this 84 is coming.
Constant dripping hollows out a stone....
Joined: Mar 22, 2005
read() returns an int, as its javadocs specify. Line "2" prints that integer, and the javadocs explain what that number means.
You are not applying the while loop to what a single read() returns, you are repeatedly calling read() and it returns a different number each time.
The real problem that I think is hindering your understanding is that lines 21 and 22 are switched around - the output does not line up the characters with their respective numerical values correctly.
You should never ignore IO exceptions; at the very least write a message to the console so that you'll know if something went wrong.
Also, you've been around the ranch long enough to know that you should UseCodeTags when posting code. It's unnecessarily hard to read it otherwise, making it less likely that people will bother to do so.