I have a method that read the next line in a txt file and does something. I have another method that needs to check for EOF as well. The two methods are called receptively within a loop.
method 1:
trace = br.readLine();
if (trace==null)
break; // end of file
method 2:
I need to check for EOF without using the same technique. Otherwise, it would increment the ptr used for readLine…
Is there any way to accomplish this?
Thanks
You can use
and read
Scanner has a
method.