Why the following piece of code generate the error "incompatible types" on the next to the last line? It works if I use Object in place of String but String is supposed to work.
java.util.Scanner myinput = new java.util.Scanner(myInFile);
while(myinput.hasNext())
{
String first = myinput.next();
System.out.println(first);
any ideas?