File IO - where do the txt files need to be located?
Hey everyone! I'm working on a program that receives the name of a .txt file through Scanner, and it prints out the number of lines that the .txt file has. The problem I'm having is- where does that .txt file need to be located in terms of a directory? It keeps returning errors such as:
"ava.io.FileNotFoundException: HeartOfDarkness.txt (No such file or directory)"
Thanks in advance, any help would be appreciated!!
Re: File IO - where do the txt files need to be located?
The files can be anywhere you like. You just have to make sure you have the correct path in your code, either absolute or relative.