Why do I get an exception called NullPointerException if in Java there is no such concept as a pointer?
Why do I get an exception called NullPointerException if in Java there is no
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes this is one of the first annoying things I learned when learning Java LOL.
It really should be called NullReferenceException, NoObjectException or DereferenceException as paxdiablo mentioned.
References don’t even have to represented internally as pointers and you shouldn’t have to care.
“Most VMs including Sun’s use handles, not pointers. A handle is a pointer to a pointer so who knows how they came up with using that?”
Oh Microsoft’s Java VM actually does use pointers rather than handles so go figure.