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