I am receiving this error on the last line of code when returning the scanner. I cannot use a throw so I need to keep the try catch in the code.
public static Scanner getInputScanner(Scanner console) {
boolean inputTest = true;
File inputFile = null;
System.out.print("Enter input file: ");
while(inputTest){
try{
inputFile = new File(console.next());
Scanner input = new Scanner(inputFile);
inputTest = false;
}catch (FileNotFoundException e) {
System.out.println("File does not exist");
System.out.print("Enter new input file: ");
inputTest = true;
continue;
}
}
return new Scanner(inputFile);
}