How does Java\'s reference variable stored? Is that work similar to C pointer?
what I mean by reference variable is myDog in this code
Dog myDog = ne
It is exactly the same as a C pointer, and almost always on the stack. In C the object itself is on the heap when you say new Dog(); but the Dog * myDogP pointer (4 or 8 bytes) need not be on the heap and is usually on the stack.
new Dog();
Dog * myDogP