例外について FileInputStreamでTryWithResourceのを使わない例
class FileInputStreamでTryWithResourceのを使わない例 {
public void method() {
FileInputStream in = null;
try {
in = new FileInputStream("A.txt");
} catch (IOException e) {
e.printStackTrace();
} finally {
try {
if (in != null) {
in.close();
}
} catch (IOException e) {
e.printStackTrace();
}
}
}
}