Search results for java



No in this case the finally block will not execute because when you say System.exit (0); the control immediately goes out of the program, and thus fin ...
There are two ways to handle exceptions, 1. By wrapping the desired code in a try block followed by a catch block to catch the exceptions. and 2. Li ...
It is not necessary that each try block must be followed by a catch block. It should be followed by either a catch block OR a finally block. And whate ...
One can not do anytihng in this scenarion. Because Java does not allow multiple inheritance and does not provide any exception interface as well. [So ...
The class should extend from Exception class. Or you can extend your class from some more precise exception type also. [Source: JAGAN MOHAN "Intervie ...
Your class should extend class Exception, or some more specific type thereof.

[Source: JAGAN MOHAN "Interview questions bible"]
Yes even if you write return as the last statement in the try block and no exception occurs, the finally block will execute. The finally block will ex ...
Runtime exceptions are those exceptions that are thrown at runtime because of either wrong input data or because of wrong business logic etc. These ar ...