Marco Tessarotto
@MarcoTessarotto
Public Repls
Community
0
TryWithResourcesin this example, try with resources is used to create a few instances of MyTask.
MyTask implements AutoCloseable, so the close method of all MyTask instances will be called on exit from try block.
when calling close method on a MyTask instance, its internal status must be "ok to close" before effectively releasing its resource, else close method will wait.
0
0