10252/difference-between-checked-and-unchecked-exception
Checked Exceptions :
The exceptions which are checked by the compiler for smooth execution of the program at runtime are called Checked Exception
If these are not handled properly, they will give compile time error
These occur at compile time
All subclasses of Exception class except RuntimeException have Checked Exception
Hypothetical Example - Suppose you are leaving your house for the exam, but if you check whether you took your Hall Ticket at home(compile time) then there won't be any problem at Exam Hall(runtime).
Unchecked Exception :
The exceptions which are not checked by the compiler are called Unchecked Exceptions
If these exceptions are not handled properly, they don’t give compile time error. But the program will be terminated prematurely at runtime
These occur at runtime
All subclasses of RunTimeException and Error are unchecked exceptions
Example - Suppose you are in your exam hall but somehow your school had a fire accident (means at runtime) where you can't do anything at that time but precautions can be made before (compile time)
Extends : This is used to get attributes ...READ MORE
We can find a big difference between ...READ MORE
The equals() method compares the "value" inside String instances ...READ MORE
Runnable is the preferred way to create ...READ MORE
If You check System.out.print(names.length); you will get 3 ...READ MORE
NoClassDefFoundError means that the class is present ...READ MORE
Your classpath is broken. Depending on how you ...READ MORE
Can’t tell you the exact reason as ...READ MORE
JRE: It stands for Java Runtime Environment. ...READ MORE
List is an ordered sequence of elements. ...READ MORE
OR
At least 1 upper-case and 1 lower-case letter
Minimum 8 characters and Maximum 50 characters
Already have an account? Sign in.