Goal
Build correct mental models for performance without premature optimization.
JVM memory (high level)
- Heap: where objects live
- Stack: method frames, local variables
Garbage collection
- You usually don’t free memory manually.
- Avoid holding references longer than needed.
- Prefer clarity first.
- Measure before optimizing.
- Avoid unnecessary allocations in hot loops.
- Use the right data structure.
Exercises
- Use
System.nanoTime() to compare two string-building approaches: + in a loop vs StringBuilder.
- Read about GC logs (optional): run Java with GC logging flags (varies by version).
Table of contents
- Getting Started: Install, run, and your first program
- Java Basics: types, variables, operators, formatting
- Control Flow: if/switch/loops
- Methods: parameters, return values, overloading
- OOP: classes, objects, encapsulation
- Inheritance & Polymorphism (and when not to use them)
- Interfaces, abstract classes, and design basics
- Exceptions and error handling
- Strings, files, and I/O basics
- Collections: List/Set/Map and Big-O intuition
- Generics (the useful parts)
- Lambdas & Streams
- Dates and time (java.time)
- Testing with JUnit 5 (basics)
- Concurrency: threads, executors, futures
- JVM basics: memory, GC, performance habits
- Build tools: Maven essentials (recommended)
- Next steps: projects to build