While messing around with the custom formatting options in Eclipse, in one of the sample pieces of code, I saw code as follows:
/**
* \'try-with-resources\'
*/
Same usage as using(Resource)
in C Sharp
,which means this resource will be automatic recycled when your program has leaven out of this code block.(Just my opinion)
The try-with-resources statement ensures that each resource is closed at the end of the statement. Any object that implements java.lang.AutoCloseable, which includes all objects which implement java.io.Closeable, can be used as a resource
The try-with-resources Statement