try-with-resources

Java 7 Project Coin: try-with-resources explained with examples

Prior to “try-with-resources” (before Java 7) while dealing with SQL Statement or ResultSet or Connection objects or other IO objects one had to explicitly close the resource. So one would write something like-

%d bloggers like this: