java使用try (){}实现资源自动释放关闭
解决方法:
try (
FileWriter writer = new FileWriter(writeName);
BufferedWriter out = new BufferedWriter(writer);
) {//执行完下面的代码自动释放资源
out.write(phoneAndMd5);
}
java使用try (){}实现资源自动释放关闭
解决方法:
try (
FileWriter writer = new FileWriter(writeName);
BufferedWriter out = new BufferedWriter(writer);
) {//执行完下面的代码自动释放资源
out.write(phoneAndMd5);
}
有建议,请留言!