You will not be unbeknownst to this famous term in programming called the NullPointerException, if you are anyway related to this coding environment.
Yes it is very annoying when it occurs but don’t you feel it is the most fun exception to resolve.
Let’s see how Developers deal with it:
*) Introduction to NullPointerException:
For those who don’t know what it is:
NullPointerException is thrown when an application attempts to use an object reference that has the null value.
In Layman’s Term…
If you try to call a person who has headphones on his/her head, most probably he/she will not able to listen you and that is my friend is NullPointerException for you.
For those who know about it:
They are still facing the exception day in and day out. They don’t need any definition or answer.
*) Good/Bad things about NPException:
Having some good points in an Exception in Java is also an exception.
The good part about the NullPointerException is that it is easily detectable and resolvable whether you are experienced or novice. Without taking much of your time, it will easily come under the vigilance of developer like taking toffee from kid’s hands.
But as obvious the bad thing about this exception is that it will occur whether or not you have done anything special to avoid it.
*) To Resolve the exception:
For resolving the issue/exception, you don’t have to become an exception in this case, just go to the line indicated in the error log and find/initialize the variable which is giving null reference.
The NullPointerException is not just a word or exception, it’s an emotion which helps developer to keep doing the good work while resolving the null reference things.
So next time when you see the NullPointerException, do not worry and keep your calm because :
“ No Exception is bigger than you, yourself!!! “
Kudossss to the world of exceptions…




Comments
Post a Comment