Have a Question?

If you have any question you can ask below or enter what you are looking for!

Category: Exception Handling

Difference between throw and throws keyword?

Difference between throw and throws keyword?

Difference between throw and throws keyword? throw keyword Sometimes we can create exception object explicitly we can handover to the JVM manually. For this, we have to use Throw keyword. Example:- throws new AirthmeticException(“/by zero”); Hence the main objective of Throw keyword is to handover our created exception object to . . . Read more

What is Exception and Exception hierarchy in Java?

What is Exception and Exception hierarchy in Java?

What is Exception and Exception hierarchy in Java? Throwable class act as the root for Java Exception Hierarchy. A throwable class defines two child classes Exception Error Exception An unexpected unwanted even that disturbs normal flow of the program is called an exception. It is highly recommended to handle the . . . Read more

Explain Default exception handling in Java?

Default exception handling in Java ?

Explain Default exception handling in Java? Inside a method, if any exception occurs the method in which it is raised is responsible to create exception object by including the following information. Name of exception Description of exception Location at which exception occurs(Stack trace). After creating exception object method handover that . . . Read more

%d bloggers like this: