memory management in Java

In Java
* Instance variables and objects live on the heap.
* Local variables live on the stack.