0
The differences between Object type and reference type?
Actually which one will hold the address of an instance object? Thanks!
1 Odpowiedź
+ 2
Object obj = new Object();
Here new Object() is the actual object that is created in the heap.
Whereas obj is a reference variable of type Object which is stored in the stack and points or holds the memory location of the newly created object.