Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我不明白为什么这段代码是错误的,我错过了什么???
try{ input = inputFile.readLine(); } finally{ inputFile.close(); } catch (IOException e){ System.out.println("I/O error: " + e.getMessage()); }
finally 应该在 catch 块之后。
try{} catch{} finaly
你可以试试这个订单
try { ... } catch (Exception ex) { //Treat exception } finally { //Clean your ressources }