View Single Post
  #1 (permalink)  
Old 07-20-2007, 03:00 AM
fred fred is offline
Member
 
Join Date: Jul 2007
Posts: 41
fred is on a distinguished road
problem with scanner class:incompatible types
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.
Code:
java.util.Scanner myinput = new java.util.Scanner(myInFile); while(myinput.hasNext()) { String first = myinput.next(); System.out.println(first);
any ideas?
Reply With Quote
Sponsored Links