Does java support pointers? I already read some threads on this topic but those are not fully understood.
If not then why there is Null Pointer Exception
?
Does java support pointers? I already read some threads on this topic but those are not fully understood.
If not then why there is Null Pointer Exception
?
No, only references. It's not like c/c++ where we have to manage the memory management by destructors. In java automatic GC works for memory management (separate thread with main). There are some contradictions are like if java doesn't support pointers then why it's throwing Null "Pointer" Exception?
Because this thing is in JVM level. From the developer perspective java is managed by references not pointers but internally(JVM) there are pointers everywhere.
Firstly, ANSWER is BIG NO for Pointers.
Answering to your second question:
Java is Object Oriented Language. Where Object can be null.