Hello,
This block of code:
public Member parseFile(String file_loc) throws FileNotFoundException{
File memberFile = new File(file_loc);
LinkedList stackList = new LinkedList();
Scanner s = new Scanner(memberFile);
while (s.hasNextLine()){
stackList.addLast(s.nextLine());
}
Produce this error:
java.io.FileNotFoundException: PA1-exampleData (The system cannot find the file specified)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(Unknown Source)
at java.util.Scanner.<init>(Unknown Source)
at a1.InformationParser.parseFile(InformationParser.j ava:37)
PA1-exampleData is a file that is passed to this procedure (within the class InformationParser) through the main of another class.
I am executing this is the same directory of the file yet the error indicates that the it cannot find the file.
This error occurs on line 37 of InformationParser, at the line reading " Scanner s = new Scanner(memberFile); ".
Am I missing something here?