What is the difference between checked and unchecked exceptions? code example

Example: checked vs unchecked exceptions

1) Checked Exception is required to be handled by 
compile time while Unchecked Exception doesn't.
2) Checked Exception is direct sub-Class of Exception 
while Unchecked Exception are of RuntimeException.
Checked Exceptions:
No Such Method Exception
Class Not Found Exception
File Not Found Exception
No Such Field Exception

Unchecked exceptions occur at runtime.
No Such Element Exception
Arithmetic Exception
Null Pointer Exception
Array Index Out of Bounds
Exception

Tags:

Misc Example