“嗨,阿米戈!”
“我以为你已经想通了定案。”
“这就是我的想法。但现在我们有了这个尝试资源的声明。”
“废话。我永远不会以这种速度学完Java。我想我什么都懂了,然后你出现了!”
“别那么担心——你会弄断油管的。相反,找出这些任务:”
6
任务
Java Multithreading, 第 1 级, 课程 10
Refactoring methods
Refactor the writeZipEntriesToFile method to use the Java 7 try-with-resources construct.
The program should not have commented code.
12
任务
Java Multithreading, 第 1 级, 课程 10
Release resources
Implement the finalize method after first thinking about what exactly it should contain.
Refactor the getUsers method to use the Java 7 try-with-resources construct.
6
任务
Java Multithreading, 第 1 级, 课程 10
AutoCloseable and try-with-resources
In the FakeConnection class, implement the AutoCloseable interface so that FakeConnection objects can be used in try-with-resources blocks.
The close() method should display the phrase "Closing database connection..."
In the try block, call the usefulOperation() method and then the unsupportedOpera