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
AutoCloseable and try-with-resources
- 6
Locked
Comments (1)
- Popular
- New
- Old
You must be signed in to leave a comment
MaGaby2280
9 June 2020, 23:01
Great explanation! Thank you!!!
0