Skip to content
Codescope

Track 03 · Java

The Java track

References vs objects, the string pool, collection internals and the garbage collector.

46 concepts mapped · 9 interactive now · 60 steps · free, no login

BeginnerStart here — no prior programming experience required.

01Foundations

5 of 5 live

Values, references, and the split that explains everything.

  1. 01

    References vs objects

    The variable is never the object. It is a handle, and handles can be copied.

    intro9 min7 steps
    0%
  2. 02

    Primitives & wrappers

    Eight types that hold values, and their object counterparts.

    intro7 min5 steps
    0%
  3. 03

    Autoboxing & the Integer cache

    int is a value. Integer is an object. Java hides the conversion, and that is exactly the problem.

    core9 min7 steps
    0%
  4. 04

    The string pool & ==

    Two strings that print the same can still be two different objects.

    intro8 min7 steps
    0%
  5. 05

    StringBuilder & concatenation

    Why building a string in a loop with + allocates every iteration.

    intro7 min6 steps
    0%
IntermediateBuild on the fundamentals with the mechanics working developers meet daily.

02Object orientation

1 of 5 live

Classes, inheritance and dispatch.

  1. 06

    Classes & instances

    Fields per object, methods shared, constructors chained.

    intro8 min5 steps
    0%
  2. 07

    Inheritance & method dispatch

    upcoming

    The object's runtime class picks the method, not the variable's type.

  3. 08

    Interfaces & default methods

    upcoming

    Multiple inheritance of behaviour without multiple inheritance of state.

  4. 09

    equals & hashCode

    upcoming

    The contract, and what breaks in collections when you violate it.

  5. 10

    Records & immutability

    upcoming

    Value-like classes, and why immutable objects are easier everywhere.

AdvancedDeep internals, specialist tooling, and the topics you reach for at scale.

03Memory & the JVM

1 of 4 live

Where objects live and how they are reclaimed.

  1. 11

    Reachability & garbage collection

    Nothing is freed because you stopped using it. It is freed because nothing can reach it.

    core10 min7 steps
    0%
  2. 12

    Generational collection

    upcoming

    Most objects die young, so the heap is split to exploit that.

  3. 13

    Leaks in a managed language

    upcoming

    A leak is a reference you forgot you were holding.

  4. 14

    Class loading & static init

    upcoming

    When a class is loaded, and when its static block actually runs.

IntermediateBuild on the fundamentals with the mechanics working developers meet daily.

04Collections

2 of 4 live

The data structures you reach for daily.

  1. 15

    ArrayList vs LinkedList

    One is an array that occasionally moves. The other is a chain of boxes scattered across the heap.

    core10 min8 steps
    0%
  2. 16

    Inside HashMap

    An array of buckets, an index derived from the hash, and a chain when two keys land together.

    core11 min8 steps
    0%
  3. 17

    TreeMap & ordering

    upcoming

    A sorted map, Comparable vs Comparator, and O(log n).

  4. 18

    Iterators & ConcurrentModificationException

    upcoming

    Why removing during a for-each throws, and what to do instead.

AdvancedDeep internals, specialist tooling, and the topics you reach for at scale.

05Generics & errors

0 of 5 live

Type safety at compile time, failure at runtime.

  1. 19

    Generics

    upcoming

    Type parameters, and the compile-time checks they buy you.

  2. 20

    Type erasure

    upcoming

    Generics vanish at runtime — which is why you cannot do new T[].

  3. 21

    Wildcards & variance

    upcoming

    Producer extends, consumer super — and why a List<Dog> is not a List<Animal>.

  4. 22

    Checked vs unchecked exceptions

    upcoming

    The stack trace as a record of the frames unwound.

  5. 23

    try-with-resources

    upcoming

    Deterministic cleanup in a garbage-collected language.

06Streams & concurrency

0 of 6 live

Declarative pipelines and more than one thread.

  1. 24

    Streams & laziness

    upcoming

    Intermediate operations build a pipeline; the terminal one runs it.

  2. 25

    Collectors & grouping

    upcoming

    Turning a stream back into a collection, map or summary.

  3. 26

    Optional

    upcoming

    Making absence explicit in the type instead of returning null.

  4. 27

    Threads & the memory model

    upcoming

    Two threads, one field, and why you need happens-before.

  5. 28

    synchronized, locks & atomics

    upcoming

    Mutual exclusion, and the cheaper options when contention is low.

  6. 29

    Executors & thread pools

    upcoming

    Submitting tasks instead of creating threads.

07JVM internals

0 of 5 live

What actually runs your bytecode.

  1. 30

    Class loading & the loader hierarchy

    upcoming12 min

    Bootstrap, platform, application — three loaders in a delegation chain.

    • Trace which loader loads String, javax.*, your own class
    • Understand parent-first delegation and when it's broken
    • Write a custom ClassLoader for plugin loading
  2. 31

    The JIT & tiered compilation

    upcoming13 min

    Interpreted at first, then C1, then C2 — and how HotSpot decides when.

    • Explain interpreter → C1 → C2 tiering
    • Read -XX:+PrintCompilation output
    • Understand deoptimisation and why the JIT sometimes gives up
  3. 32

    Escape analysis & stack allocation

    upcoming11 min

    Objects that don't escape their method can live on the stack — no GC involved.

    • Predict which objects a JIT will scalarise
    • Write allocation-free hot loops
    • Measure the win with -XX:+PrintEscapeAnalysis
  4. 33

    Method inlining decisions

    upcoming10 min

    The single biggest source of speed the JIT gives you, and why it sometimes doesn't.

    • Identify what stops the JIT from inlining a method
    • Split hot methods to help inlining
    • Read -XX:+PrintInlining output
  5. 34

    Reflection & dynamic dispatch cost

    upcoming9 min

    Method.invoke is orders of magnitude slower than a direct call — for reasons.

    • Benchmark direct call, reflected call, MethodHandle
    • Use setAccessible to skip access checks
    • Cache Method objects; never look them up in a hot path

08Concurrency deep

0 of 5 live

The primitives inside java.util.concurrent.

  1. 35

    The Java memory model

    upcoming13 min

    happens-before, volatile, and why unsynchronised reads can see stale data forever.

    • Read a happens-before edge between two threads
    • Use volatile for visibility without atomicity
    • Recognise which JMM rules make double-checked locking work
  2. 36

    Fork/Join & work stealing

    upcoming12 min

    A pool where idle threads steal tasks from busy queues.

    • Split a recursive task into RecursiveTask<V>
    • Understand work stealing and why it beats round-robin
    • Use commonPool sensibly (or avoid it)
  3. 37

    ConcurrentHashMap & friends

    upcoming12 min

    Thread-safe collections that don't lock the whole thing.

    • Use ConcurrentHashMap.compute atomically
    • Choose between ConcurrentHashMap, CopyOnWriteArrayList, ConcurrentSkipListMap
    • Understand why size() is only approximate under load
  4. 38

    AtomicInteger, LongAdder & VarHandle

    upcoming11 min

    Wait-free counters — LongAdder is often 10× faster than AtomicLong under contention.

    • Use CAS with AtomicReference for lock-free updates
    • Choose LongAdder when writes dominate reads
    • Access fields with VarHandle instead of sun.misc.Unsafe
  5. 39

    Virtual threads (Project Loom)

    upcoming12 min

    Millions of lightweight threads that block cheaply on I/O.

    • Start virtual threads with Thread.ofVirtual
    • Understand carrier threads and pinning
    • Refactor a reactive pipeline back to blocking code without losing throughput

09GC deep

0 of 3 live

The garbage collectors you actually pick between in production.

  1. 40

    The G1 collector

    upcoming12 min

    Region-based collection with predictable pause targets.

    • Understand young/old regions and the collection set
    • Tune -XX:MaxGCPauseMillis and what it actually promises
    • Read a G1 log to spot mixed-collection pain
  2. 41

    ZGC & Shenandoah

    upcoming12 min

    Sub-millisecond pauses via concurrent compaction and load barriers.

    • Explain coloured pointers and load barriers
    • Compare CPU overhead versus pause time trade-off
    • Choose ZGC for latency, G1 for throughput
  3. 42

    GC tuning fundamentals

    upcoming11 min

    Heap size, allocation rate, and reading GC logs like tea leaves.

    • Size -Xmx from steady-state and peak live set
    • Compute allocation rate from GC logs
    • Diagnose promotion failures and humongous allocations

10Modern Java

0 of 4 live

Language changes that shape idiomatic modern Java.

  1. 43

    Records & pattern matching

    upcoming10 min

    Data-only types that destructure directly in switch and instanceof.

    • Deconstruct records in switch expressions
    • Combine records with sealed hierarchies for exhaustiveness
    • Understand why records get equals/hashCode for free
  2. 44

    Sealed classes & exhaustive switch

    upcoming10 min

    Close a hierarchy so the compiler can check every case.

    • Seal a hierarchy with permits
    • Get compile-time exhaustiveness on switch expressions
    • Model algebraic-data-type-like sums in Java
  3. 45

    Pattern matching in switch

    upcoming11 min

    Type patterns, guarded patterns, deconstruction — one construct for many jobs.

    • Use type patterns to replace instanceof + cast chains
    • Guard patterns with when clauses
    • Deconstruct records inside case labels
  4. 46

    The Foreign Function & Memory API

    upcoming12 min

    Call native code without JNI, and share memory with it safely.

    • Look up a symbol with SymbolLookup
    • Bind a downcall handle to a C function
    • Allocate and read a struct with MemoryLayout

The full syllabus is listed above in teaching order. Concepts marked upcoming are mapped but not yet built as visualizations. Progress is kept in this browser only.