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\'
*/
it was added in java 7. It is called try with resources. Try with resources statement feature was introduced in java 7 version. Try with resource statement is a try statement that declares one or more statements. A resource is an object that must be closed after the program is finished with it.
Before java 7 we use finally block to close the resources that we have used in our program. In finally block we have to close all the resources manually that we have used in our program. For more information you can visit try with resources