What is an exception?
An exception may arise for a variety of causes.
Following are some scenarios where an exception occurs.
What is Exception Handling?
Hierarchy of Java Exception classes:
Types of exceptions
Checked exceptions
IOException:
Output:
C:\Java\rreadFile.txt (The system cannot find the file specified)
ClassNotFoundException:
Example:
Output:
java.lang.ClassNotFoundException: DumbSchool
Unchecked Exceptions
ArithmeticException:
Output:
/by zero
Change value of a , a value can not be zero
Complete
NullPointerException:
Example:
Output:
/by zero
Change value of a, a value can not be zero
Visited 1 times, 1 visit(s) today