Learn Java β€” fundamentals, the modern way

A structured path through the Java language β€” from primitives to generics. Modern Java (17/21) idioms, runnable examples, and the common mistakes everyone hits.

πŸ“š 12 core topics πŸ” 91 deep-dive pages ⚑ Runnable examples πŸ†• Java 17 & 21

Foundation

Second tier

Bonus topics

How to use this section

Each pillar page covers a core area of the Java language end-to-end β€” what it is, how it works, modern idioms (record, var, sealed classes, pattern matching), and the common mistakes. Each pillar links down to spoke pages that go deep on a single concept (one keyword, one collection, one exception type).

If you're new to Java

Read in this order: Primitives β†’ Variables β†’ Control flow β†’ Methods β†’ OOP β†’ Collections β†’ Exceptions.

If you came for one specific topic

Use the search bar in the header, or jump straight to the relevant pillar above. Spoke pages are linked from the pillar's table of contents.

Modern Java first

Examples target Java 17 (LTS) and Java 21 (LTS). Where a feature is newer, the Java version requirement is called out. Where the legacy approach is still common in the wild (e.g. SimpleDateFormat, raw HashMap, anonymous inner classes), it is shown alongside the modern idiom so you can read both old and new code.

Try every example live

Most snippets are runnable in the Java Online Compiler without setup. When a snippet uses an external library (Jackson, Lombok, JJWT), it's flagged.