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?
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.
Object references are nothing but pointers but they are not complex as Pointers. Have a look at this for difference.
NullReferenceException...