Hierarchy of Exception in Java
The basic exception root class of Java is java.lang.Throwable class. We explain some common exceptions and errors. These are divided into two main classes: exception and error.
IOException:-
It belongs to the input and output operation. It works when reading, writing, and searching files. It is also called a checked exception.
NumberFormatException:-
It represents an attempt to convert a string into a numeric value such as a float or integer.
AirthmeticException:-
It represents an invalid arithmetic exception, such as a division by zero.
StackOverflowError:-
This error occurs when the allocated memory overflows the stack.
OutOfMemoryError:-
It is the heap base error, and this error occurs when there is insufficient allocated space in the Java heap.
FAQs
Yes, but it must be followed by a finally block.
RANREV INFOTECH