我有以下代码:
// Read properties file.
Properties properties = new Properties();
try {
properties.load(new FileInputStream("filename.properties"));
} catch (FileNotFoundException e) {
system.out.println("FileNotFound");
}catch (IOException e) {
system.out.println("IOEXCeption");
}
需要关闭FileInputStream吗?如果是,我该如何关闭?我的代码检查清单中出现了不良实践错误。要求我在finally块中加入关闭语句。