I am been having a great curiosity.
I have written some java code & it is showing Null Pointer Exception. I am curious to know
Why java gives Null Pointer Exception even if it does not support pointers?
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.
Java does support pointers (which you use everytime you have a
.or a[).It doesn’t support pointer arithmetic – i.e. the ability to manipulate a pointer into another pointer using math.
To point this out to converted C/C++ programmers, they did not carry the C name over, but named it something else. At the JVM level everything is pointers, but as Java programmers only see this when using references, the exception is badly named.