标签:style io ar color os 使用 sp java on
Interface Appendable
java.io.IOException - 如果发生 I/O 错误
package cc.openhome;
public class Main {
public static void main(String[] args) {
try(Resource res = new Resource()) {
res.doSome();
} catch(Exception ex) {
ex.printStackTrace();
}
}
}
class Resource implements AutoCloseable {
void doSome() {
System.out.println("做一些事");
}
@Override
public void close() throws Exception {
System.out.println("资源被释放");
}
}
标签:style io ar color os 使用 sp java on
原文地址:http://blog.csdn.net/wenwen091100304/article/details/41925941