2075 2

CSC419 ยท 2075 ยท 10 marks

Why do we need to handle the exception? Distinguish error and exception. Write a program to demonstrate your own exception class.

Why do we need to handle the exception? Distinguish error and exception. Write a program to demonstrate your own exception class.[10]

Advanced Java ProgrammingChapter 1: Programming in JavaCreating Exception Class

Exception handling is needed for the following reasons: 1. To maintain normal program flow: Without handling, an exception causes the program to terminate abruptly. Handling allows the rest of the code to continue executing. 2. To avoid program crash: Unhandled exceptions crash the application. H...