Skip to content
scanner cant read
Profile icon
Annkar

why? how do I do?
shoudent ;
Scanner a =new Scanner(new File("klasslista.txt"))
be enough to put "klasslista.txt" in a??

You are viewing a single comment. View All
Profile icon
SixBeeps
  • hasNextLine is a method, not a field
  • the L in nextline should be capitalized
  • equals should be called like obj1.equals(obj2), not obj1.equals.obj2 like you did on line 24
  • you never declared the variable "index", but are using it on line 25
Profile icon
Annkar

@SixBeeps

you are a hero! but now it directly points at scanner and claiming wrong,you don't happen to have a solving to that too maby? anyhow I am a lot gretfull.

Profile icon
SixBeeps

@Annkar
You're using the variable myFile, but you never declared it.

Profile icon
Annkar

@SixBeeps
lol… how do I declare it?
I mean if it had just been a normal variable I could do a
int myFile;//or string or boolean or whatewer
but a file variable is like a scanner variable and well I dont understand.