For the assignment, I created text files
and defined main class for the test
public static void main(String[] args)
{
File input1 = new File("inputFile1.txt");
File input2 = new File("inputFile2.txt");
CalcCheck file1 = new CalcCheck(input1);
CalcCheck file2 = new CalcCheck(input2);
file1.CheckStart();
}
After I defined main class,
I defined other class
private File checkingFile;
CalcCheck (File files)
{
checkingFile = files;
}
void CheckStart()
{
Scanner sc = new Scanner (checkingFile);
System.out.println("checking start");
checkFileNull();
} ...
However, the Scanner sc = new Scanner (checkingFile)
throws
FileNotFoundException
.
Can someone tell me what is the problem?