When creating a PrinterWriter
object:
PrintWriter outputFile = new PrintWriter(*FileName*);
Where is the compiler looking when it goes to find FileName? For example, in Eclipse I am working in Arrays/src/ArraysAndFiles.java. In this example I am trying to open Values.txt. I have created this file in the src directory since that is where ArraysAndFiles.java is stored. When I attempt to open the file in the following code I get a FileNotFoundException
:
import java.io.PrintWriter;
public class ArraysAndFiles {
public static void main(String[] args) {
// TODO Auto-generated method stub
PrintWriter outputFile = new PrintWriter("Values.txt");
}
}
What is the proper path to Values.txt?