Stack stores local variables and method calls. Heap stores all objects and their instance variables.
← Java theorytheory 0/50 · 0%
JVM · medium
21. JVM Memory Model (Heap vs Stack)
How memory is structured.
Check your understanding
1. Where does 'new Object()' go?
2. Is the Stack shared between threads?