public static Scanner getFileScanner()
{
try{
Scanner input = new Scanner(System.in);
String file = input.nextLine();
Scanner fs = new Scanner(new FileReader(file));
}catch (FileNotFoundException fe) {
System.out.println("Invalid filename. Try another:");
getFileScanner();
}finally{
return fs;
}
}
我一直收到找不到變量fs的錯誤。我無法弄清楚爲什麼我的生活。在java中遞歸地構建帶有嵌入式FileReader的掃描器