
**The Java language does not provide pointers. Instead all objects are handled by references not to be confused with pointers or C++ references. The difference is that Java references do not refer directly to the memory location but rather contain the pointer to the actual memory location which the programmer cannot get direct access to. This extra level of indirection is required for GC to work. When GC kicks in and frees objects that are no longer in use it then does heap compaction to defragment the heap. To do this some objects must be moved around in memory. This is possible because there is only one place where this pointer is located in the reference and thus the memory can be relocated old location freed and pointer changed. In C++ this is not possible because pointers are copied all over the code. It is also true that pointers are dangerous and lead to memory leaks memory corruption invalid memory access e.g. from uninitialized and improperly initialized variables indexing out of bounds and many bugs due to pointer arithmetic. References and other features related to these avoid all these problems.**
If you are facing any programming issue, such as compilation errors or not able to find the code you are looking for.
Ask your questions, our development team will try to give answers to your questions.