Finally block

We know that whenever exception occurs, we need to handle such exception using try/catch But, If we miss to handle such exception then program terminates abruptly. This skips some of the important statements to be executed in the program. So, in such scenario, finally blocks comes to rescue us. All the statements or a piece […]

Share this article on

Exception handling – throws

We already know that, we can handle exceptions using try-catch block. But in some cases, its good to use “throws” instead of using ty-catch block. In some cases, its not required to handle the exception in a method which is called by another method so that caller will handle this exception. Client program knows how […]

Share this article on
< Previous Next >