Alright, I am having serious trouble. Okay maybe not serious, but not understanding this is causing me unnecessary stress. Went out to drink tonight, and I could not enjoy myself, because of this.
Now the program creates a text file, writes data into it, and then reads the data to the user. Simple enough, but the problem is I get this error "Exception in
thread "main" java.lang.IllegalStateException: Scanner closed". The program works it writes the data, displays the data, but it gives me this error. Now I have narrowed down the error the readFile() method near my while loop. If I close the scanner in the loop it does what I require it to do, but if I close the scanner outside the loop I do not get the exception, but it does not write the data into the text file. I know that I have to close the scanner, because it' not a stream, but easier said then done. Can someone please give me guidance on this issue. I have been to numerous sites, but haven't gotten a solid explanation on this.
Sorry.
[