Checked Exception
Are those which can be caught at compile time.Example - FileNotFound exception
If some file that you are trying to read is not present at given location. At compile time, java compiler will throw that exception to your code.
Unchecked Exceptions
Are those which can be caught at runtime only.
Example - NullPointer ExceptionUnchecked exceptions are thrown by JVM at runtime. JVM will throw Exception object that you need to catch using Try and Catch blocks in your code.
0 Comments
Post a Comment