Java - Interview Questions and Answers on Pointers

Q1.  Why Java don't use pointers ?

Ans. Pointers are vulnerable and slight carelessness in their use may result in memory problems and hence Java intrinsically manage their use. 

Q2.  Difference between C++ and Java ?

Ans. Java does not support pointers.

Q3.  Do you think that Java should have had pointers ?


Q4.  Difference between a Pointer and a Reference ?

Ans. We can't get the address of a reference like a pointer. Moreover we cannot perform pointer arithmetic with references.

Q5.  When does an application throw NullPointerException ?

Ans. When it tries to access an object element or method using reference which is actually null.