Greeting,
I’m using netbeans on a MacBook. I’ve written a small program that reads a text file. However, the program isn’t reading the file. I’m receiving my FileNotFoundExepection error message. Where can I place my out.txt file so that the program is able to locate the file in this simple code below.

public class TextFileInputDemo {

/**
* @param args the command line arguments
*/
public static void main(String[] args) {
// TODO code application logic here

String fileName = "out.txt";
Scanner inputStream = null;
System.out.println("The file " + fileName +
"\ncontains the following lines:\n");
try
{
inputStream = new Scanner(new File(fileName));
}
catch (FileNotFoundException e)
{
System.out.println("Error opening the file " + fileName);
System.exit(0);
}
while (inputStream.hasNextLine());
{
String line = inputStream.nextLine();
System.out.println(line);
}
inputStream.close();

}
}