-1
運行下面的代碼時出現編譯錯誤。在try-catch塊之後的if語句中,編譯器無法「解析爲變量」。不過,我已經初始化了這些變量。任何幫助將非常感激。嘗試捕捉本地化變量
public void Load(UniversityListing uListing, StudentBody sBody) {
try {
FileInputStream fIn1= new FileInputStream(filename1);
BufferedReader bufferedReader1 = new BufferedReader(new InputStreamReader(fIn1));
existence1 = true;
}catch(FileNotFoundException ex){
System.out.println("Unable to open file '" + filename1 +"'");
existence1 = false;
}catch(IOException ex){
System.out.println("Error reading file '" + filename1+ "'");
existence1 = false;
}
if (existence1 == true){
LoadUListing(uListing, bufferedReader1,fIn1);
}
}
後的錯誤細節 – KeithC