The problem In Java, when we create an object, it is stored in the Heap memory. All the objects in Heap are accessed through references. We can consider reference as a pointer to an object in Heap. If a program…
The problem In Java, when we create an object, it is stored in the Heap memory. All the objects in Heap are accessed through references. We can consider reference as a pointer to an object in Heap. If a program…