NullPointerException:
NullPointerException is very common exception we see in development, One thing we don't observe is that this exception raises at runtime.
So we can say NullPointerException comes under RuntimeException. It is not an error, because Java runtime is displaying the exception on to the console, errors are not displayed on to console , errors are nothing but logical errors, JVM doesn't know how to handle them, Developers responsibility to handle errors.
If we see in the Exception hierarchy NullPointerException is the child class of RuntimeException which can be throwable but at runtime.
NullPointerException is very common exception we see in development, One thing we don't observe is that this exception raises at runtime.
So we can say NullPointerException comes under RuntimeException. It is not an error, because Java runtime is displaying the exception on to the console, errors are not displayed on to console , errors are nothing but logical errors, JVM doesn't know how to handle them, Developers responsibility to handle errors.
If we see in the Exception hierarchy NullPointerException is the child class of RuntimeException which can be throwable but at runtime.
No comments:
Post a Comment