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()); }
最終的には catch ブロックの後に来る必要があります。
try{} catch{} finaly
この順序で試すことができます
try { ... } catch (Exception ex) { //Treat exception } finally { //Clean your ressources }