Chapter Five Exception Handling 2023
Chapter Five Exception Handling 2023
Contents
It affects the flow of the program execution which can cause the
program to terminate abnormally.
Exception handling enables you to create applications that can resolve (or
handle) exceptions.
Advantages of Exception Handling
The core advantage of exception handling is to maintain the normal
flow of the application.
– An exception normally disrupts the normal flow of the application; that is
why we need to handle exceptions
– If these exceptions are not handled/declared in the program, you will get
compilation error
import java.io.*;
public class Main {