Checked Exception
The exception which is checked by the compiler for the normal execution of a Java program is known as a checked exception. In our program there is a chance of raising a checked exception then we must handle that checked exception either by using try-catch or throws keywords otherwise we will get compile time error.
Unchecked Exception
The Exceptions which are not checked by the compiler whether the programmer handles that exception or not such type of exceptions are known as unchecked exceptions.
Note–
- Every exception occurs at runtime whether it is a checked exception or unchecked exception.
Similar Java Tutorials
- Odd Even in Java
- Fibonacci Series Java
- Switch statements in Java
- For loop in Java
- While loop in Java
- Do while loop in Java
- Import statement in Java
- Abstract modifier in Java
- Strictfp modifier in Java
- Final variable in Java
- Adapter Class in Java
- Method signature in Java
- Method overloading in Java
- Has A Relationship
- Inheritance in Java
- Encapsulation in Java
- Abstraction in Java
- Data Hiding in Java
- Interface vs abstract class
- Method Overriding in Java
- Method Overloading in Java
- Coupling in Java
3 thoughts on “Checked Exception vs Unchecked Exception”