Welcome to the
Java Ranch,
The stack stores local variable for methods. There is a stack for each active
thread.
The heap stores objects.
The methods themselves, the byte code, is stored in a special area along with static variables.
Some object reference variables are stored in the stack (if they are local variables). Some object reference variables are stored in the heap (if one object has a reference to another).
Kaydell