Java theorytheory 0/50 · 0%
JVM · medium

21. JVM Memory Model (Heap vs Stack)

How memory is structured.

Stack stores local variables and method calls. Heap stores all objects and their instance variables.

Check your understanding

  1. 1. Where does 'new Object()' go?

  2. 2. Is the Stack shared between threads?