How Java works

Pick a topic, write code and watch what happens inside, step by step.

Memory

Collections

Concurrency

Language and JVM

Topics

JVM: Stack and Heap

Write Java code and follow, line by line, where each variable lands in memory.

Stack

Cleared when a method ends

Heap

4 the value itself reference: the value is where the line goes

This is the memory model of the Java language. While running, the JIT compiler may optimize some objects so they never reach the heap.