Updated Jun 22, 2026

Java From Zero

Java has been quietly running the world for thirty years. It's behind Android apps, the backends of most large banks and enterprises, Minecraft, and an enormous share of the systems that move money and data around the planet. That longevity comes from a deliberate bet: write once, run anywhere - your code compiles to bytecode that runs on the JVM (Java Virtual Machine), the same on a laptop, a server, or a phone. Java values stability, readability, and tooling over cleverness, which is exactly why teams keep choosing it for software that has to keep working for a decade.

This guide takes you the whole way: from "I've never run javac" to understanding what Java and its runtime are actually doing underneath your code. We go mental-model-first the whole way: before any command, you'll understand what the thing actually is and why Java made the choice it did.

📝 This guide teaches the language. If you've never programmed at all, start with Programming From Zero first - it covers the universal ideas (what a program is, variables, loops) every language shares. Then come back here.

It's one zero-to-hero journey in two halves. Phases 1–9 are the basics - enough to write real, well-organized object-oriented programs. Phases 10–17 are the deep half - generics, lambdas and streams, modern Java (records, sealed types, pattern matching), concurrency, the JVM and garbage collector, testing, and performance, the stuff that separates "writes Java" from "understands Java." Each phase carries a difficulty badge so you can see the climb.

How to read this

  • Brand new to Java? Read 1–9 in order, top to bottom - each builds on the last. Type the examples yourself; doing beats reading. Come back for 10+ when the basics feel comfortable.
  • Already know another language? Skim phases 1–4 for Java's spelling of ideas you have, then slow down at Phase 5: Classes & Objects - object-orientation is Java's whole worldview, and everything after it assumes you think in objects.
  • Past the basics already? Jump to the deep half - Phase 10: Generics, Deep onward is where Java stops being "a verbose OOP language" and becomes one you can reason about down to the garbage collector.

The phases

Part 1 - The basics (🟢 Basic → 🟡 Intermediate)

  1. Install & Your First Program 🟢 - the JDK, javac/java, the JVM, a real Hello.
  2. Syntax, Values & Types 🟢 - primitives vs objects, var, static typing, strings.
  3. Collections 🟢 - arrays, List/ArrayList, Map/HashMap, Set, and generics for collections.
  4. Control Flow & Methods 🟢 - if/switch/loops, methods, and overloading.
  5. Classes & Objects 🟡 - Java's whole worldview: classes, fields, constructors, this, encapsulation.
  6. Inheritance & Interfaces 🟡 - extends, interfaces, polymorphism, and abstract.
  7. Errors & I/O 🟡 - checked vs unchecked exceptions, try/catch/finally, try-with-resources, files.
  8. Packages, Build & Tooling 🟡 - packages, the classpath, Maven/Gradle, JARs, the ecosystem.
  9. Idioms & Gotchas 🟡 - the Java way, and the traps (null, == vs equals, autoboxing) that bite everyone once.

Part 2 - Beyond the basics (🔴 Advanced) 10. Generics, Deep 🔴 - bounded types, wildcards (? extends/super), and type erasure. 11. Lambdas & Functional Interfaces 🟡 - lambdas, method references, and the functional-interface system. 12. The Streams API 🟡 - declarative pipelines: map/filter/collect, laziness, and parallel streams. 13. Records, Sealed Types & Modern Java 🟡 - records, sealed classes, switch expressions, pattern matching, Optional. 14. Concurrency & Threads 🔴 - threads, synchronized, the memory model, ExecutorService, CompletableFuture, virtual threads. 15. The JVM: Memory, GC & JIT 🔴 - heap vs stack, the garbage collector, JIT compilation, and class loading. 16. Testing, Build & Profiling 🟡 - JUnit, table-driven tests, Maven/Gradle deeper, and profiling with JFR. 17. Performance & the Ecosystem 🔴 - cutting allocation/GC pressure, measuring first, and the Java ecosystem.

Finale 18. Where to Go Next 🟢 - Spring Boot, Android, big data, and what to build.

Frameworks (Spring Boot, Android, Jakarta EE) are their own world - this guide makes the language and the JVM make sense, top to bottom.


Phase 1: Install & Your First Program →