That's because "filename" is defined as a String. You don't do a file operation on a filename. In your case, you use the filename to open a FileInputStream. You then can call readline() on that stream.
Go through
this tutorial[
^] because you're going to have to rewrite your code a little bit.