thecodex.expert · The Codex Family of Knowledge
Track 3 — Advanced

Java: Advanced

Five lessons: concurrency, virtual threads, modern Java features, and Kotlin.

🕐 ~7 hours5 lessonsJava 21 LTS

Lessons

Lesson 1

Concurrency: threads and locks

Thread, Runnable, synchronized, volatile, data races, AtomicInteger, and the Java Memory Model.

Prerequisite: Practitioner track complete

What to look for:

  • Data race: count++ is not atomic
  • synchronized: mutual exclusion + visibility
  • volatile: visibility only
  • happens-before rules
🕑 60 min
Lesson 2

Thread pools and CompletableFuture

ExecutorService, Future.get(), CompletableFuture chains, and virtual threads (Java 21).

Prerequisite: Lesson 1 of Advanced

What to look for:

  • CompletableFuture chain pattern
  • Virtual threads: newVirtualThreadPerTaskExecutor
  • shutdown() graceful termination
  • supplyAsync + thenApply + exceptionally
🕑 60 min
Lesson 3

Records, sealed classes, and pattern matching

Record syntax, sealed interface, exhaustive switch in Java 21.

Prerequisite: Lesson 2 of Advanced

What to look for:

  • Record compact constructor for validation
  • Sealed interface permits clause
  • Exhaustive switch on sealed — no default needed
  • Records vs Lombok @Data
🕑 45 min
Lesson 4

JVM internals and garbage collection

JVM architecture, bytecode, JIT compilation, G1GC, ZGC, and heap flags.

Prerequisite: Lesson 3 of Advanced

What to look for:

  • ClassLoader → Bytecode Verifier → JIT pipeline
  • G1GC is default since Java 9
  • -Xmx and -Xms flags you will use always
  • GC pause times: G1 vs ZGC tradeoff
🕑 60 min
Lesson 5

Kotlin introduction

How Kotlin improves on Java — null safety, data classes, extension functions, and Java interop.

Prerequisite: Lessons 1-4 of Advanced

What to look for:

  • val vs var vs Java final
  • data class vs Java record
  • Null safety: String vs String?
  • 100% Java interop — calling any Java library
🕑 45 min

How to use this track: Each lesson links to the Codex reference page. Use reading level tabs (Curious / Exploring / Deep Dive). Check "What to look for". Take the quiz when ready.

Track quiz

4 questions on the Advanced track.

Why is count++ not thread-safe?

What is the key advantage of Java 21 virtual threads?

What does a sealed interface guarantee?

What does -Xmx512m do?

← Practitioner trackKotlin →