enfrptes

sendassignment@tutorspoint.com

Uses of Exception Handling Homework Help

Online Tutorspoint Java assignment experts provide assistance in completing university java projects and under programming topics like uses of exception handling homework help.

What are the Uses of Exception Handling?

a) We can know in which part of the program the logical error has actually occurred.

b) We are not allowing the JVM to terminate the entire program. Only the try block in which the error has occurred would be terminated.

Thus, this is an easy way of debugging the program.

c) Once control enters the catch block, it executes the statements in the catch block and moves on further. It will not come back to the try block because of which the catch block was executed.

d) If no exception class object is created in the try block, the control will never enter the catch block.

e) Every try block should be associated with at least one catch block.

f) A try block can have any number of catch blocks.

For each and every statement in the try block which is proven to generate an exception class object, there should be a corresponding catch block.

Disadvantages of this approach

If statements in the try block are more than generating the exception class object, then we should have those many catch blocks which are not feasible.

The user should have knowledge regarding, what statement is proven to generate what type of exception class object. At times, this would be very difficult.