I have this simple code:
PrintStream p = new PrintStream(new File("test.txt"));
p.println("asd a'da fd g' dsdg");
p.println("sdf asm,m gt, thmm ..m kl");
Scanner s = new Scanner(new File("test.txt"));
while (s.hasNextLine())
String m = s.nextLine();
Error: not a statement
My question is why doesn't this work. I don't see it and I feel really stupid. =(
I know its stupid code. I wrote it that way. I also realize if the code actually worked m would only store the last line in the file. However, why does it not work?
Scanner Help
Started by Exem, Nov 27 2009 03:25 PM
1 reply to this topic


Sign In
Create Account


Back to top









