Try with resource

Try-with-resources in Java 7 is a new way of exception handling which makes it easier to automatically close resources that are used within a try-catch block. A resource is an object that must be closed after using it. Example : A file resource for file IO operations, JDBC resource for database connection etc. Before this […]

Share this article on

Exception handling – best practices

Exception handling is one of the non-functional requirements for any application development. We should handle erroneous situations gracefully using exception handling. Example : Invalid input, File not found in system while reading , number format is not correct etc. Java provides exception handling to handle these scenarios using try-catch blocks. There are some set of […]

Share this article on
< Previous Next >