All topics / Java From Zero

Java From Zero

Learn Java from nothing to genuinely advanced: install the JDK and the basics — types, classes, objects, collections — then the deep half: generics, lambdas and streams, modern records and pattern matching, concurrency, the JVM and its garbage collector, testing, and performance. Mental-model-first, with honest explanations.

  1. Install & Your First Program — The JDK, javac & the JVM Java compiles to bytecode that runs on the JVM — write once, run anywhere. Install a JDK, write Hello.java, compile it with javac, run it with java, and learn why everything lives in a class.
  2. Syntax, Values & Types — Primitives, Objects & Static Typing How Java thinks about values: a compiler-checked type on every variable, the deep split between primitives and objects, wrapper types and autoboxing, the var keyword, and why you never compare strings with ==
  3. Collections — Arrays, Lists, Maps & Sets Arrays are fixed and rigid; the Collections Framework is where real Java lives. Here's the List/Map/Set mental model, ArrayList, HashMap, and HashSet — and why you program to the interface.
  4. Control Flow & Methods — Decisions, Loops & Reusable Logic How Java branches with if/else and switch, repeats with for/while/for-each, and packages logic into methods — plus method overloading and why the compiler picks the right one.
  5. Classes & Objects — Java's Whole Worldview A class is a blueprint; an object is one thing built from it with new. Here's fields, constructors, this, instance vs static, encapsulation, and the toString/equals/hashCode trio every Java beginner trips on.
  6. Inheritance & Interfaces — Sharing Behavior How Java classes share behavior: inheritance with extends, overriding methods, polymorphism, interfaces as contracts, and the honest call between an interface and an abstract class.
  7. Errors & I/O — Exceptions, Resources & Files Java's error model is the exception — a thrown object that unwinds the stack until caught. Here's try/catch/finally, the checked-vs-unchecked split the compiler enforces, throwing your own, try-with-resources, and modern file I/O.
  8. Packages, Build & Tooling — From Files to a Real Project How Java organizes code into packages, how the classpath lets the JVM find your classes and libraries, why Maven and Gradle exist, and what JARs and dependencies really are.
  9. Idioms & Common Gotchas — Write It Like a Java Dev, Dodge the Traps Java idioms that make code read like Java — program to interfaces, prefer immutability, return Optional not null, loop with streams, write real equals/hashCode — plus a cheat-card for the classics: == vs equals, NPEs, autoboxing, integer division, and shared state.
  10. Generics, Deep — Type Safety Without Duplication Generics move type safety from runtime to compile time. Generic methods and classes, bounded type parameters, wildcards and PECS, and why type erasure makes generics vanish at runtime.
  11. Lambdas & Functional Interfaces — Functions as Values Lambdas let you pass behavior around like data. Here's the mental model: a lambda is an instance of a functional interface (a SAM), why that target type is required, the built-in vocabulary Streams speaks, and method references.
  12. The Streams API — Declarative Data Pipelines Streams let you describe what to do to a collection — filter, map, reduce — as a readable pipeline instead of a hand-rolled loop. Here's the source/intermediate/terminal shape, laziness, the common operations, Collectors (including groupingBy), and when parallel streams help.
  13. Records, Sealed Types & Modern Java — Less Boilerplate, More Safety Modern Java fixes old pain: records collapse data classes to one line, sealed types fence a hierarchy, switch becomes an expression, and pattern matching plus Optional kill whole categories of boilerplate and null bugs.
  14. Concurrency & Threads — Doing Many Things at Once, Safely Threads let your program do many things at once — and quietly corrupt shared data while doing it. Here's race conditions, synchronized, the memory model, the java.util.concurrent toolkit, and virtual threads.
  15. The JVM: Memory, GC & JIT — What Runs Your Bytecode What's underneath every Java program: the virtual machine that runs your bytecode, splits memory into stack and heap, collects garbage so you never free(), and recompiles hot code to native speed.
  16. Testing, Build & Profiling — Proving It Works, Finding the Slow Part JUnit 5 tests with the arrange-act-assert shape, parameterized and nested cases, Mockito in moderation, why naive microbenchmarks lie and how JMH fixes them, plus JFR profiling and JaCoCo coverage.
  17. Performance & the Ecosystem — Measure, Then Cut Allocations Java performance is measurement first, algorithm second, allocations third. Profile the real hot path, fix the big-O, cut the short-lived objects that pressure the GC — then meet the ecosystem you're now ready for.
  18. Where to Go Next — Putting Java to Work You learned the language and the JVM; now you apply it. Honest signposts to the branches from here — Spring Boot, Android, big data, Jakarta EE — plus what to build to make it stick.