0
When java does not support pointer then why we will get NullPointerException
3 Antworten
+ 1
Java does not support pointers but Reference Variable that store reference addresses generally called Objects ( pointers like concept) .
Pointers points to variable directly but java’s reference variable points to some other places which carries the address of the data variable. In this way java does not support pointers.
And NullPointerException is thrown when an application attempts to use an object reference that has the null value.
0
Java does not support pointer but it can have null values for objects which are declared but not initialized any values..
0
because internally uses it if there is Object,
you can copy the value of this 'pointer', but can't increment it or get a reference of primitive type like int a