Each read method has its own way of signalling EOF when you attempt to read past the end of file, eg returning -1 for the number of bytes read. Because some read methods return (eg) Strings don't return a number, they have to signal EOF some other way, such as returning a null. Check the API doc for the read method(s) you are using to see how they return EOF.
The readLine() method that you use, in which class it belongs to? Because if you use the BuffereReader class, then when that method returns null it means that it has reached the end of the file.
If the file's last line is for example: "aaa"
Then when you call the readLine, for the last line it will return the: "aaa" and if you call it again it will return null.
If you are using Scanner, check the API for the method hasNextLine (I think)
In your case, take the line, and handle it only if it is not empty !line.trim().equals("")
Thank You Java Addict and James Cherril
I think You are correct about the "" character rather than the null character.
And as far as hasNextLine() is concerned the method i found in the API is hasNext() which returns String