Basics
5 lessons · setup · types · operators · control flow · methods
01. Getting Started with Java
Basics · Prerequisite: none
Java is a statically-typed, object-oriented programming language that has been an industry workhorse since its 1995 release. In this lecture you'll install JDK 21 LTS, pick an IDE, and compile + run your first program.
02. Variables and Types
Basics · Prerequisite: previous lecture
A variable is a "labeled box" that holds data. Java is a **statically-typed** language, so the type of each variable must be declared up front. This lecture covers the 8 primitive types, type conversion, and the `var` keyword (JDK 10+).
03. Operators and Expressions
Basics · Prerequisite: previous lecture
Operators take operands and produce new values. Java's operators look familiar to anyone coming from C/C++, but watch out for **object comparison (`==` vs `.equals()`)** and **integer / floating-point division** — this lecture untangles both.
04. Control Flow
Basics · Prerequisite: previous lecture
**Control flow** statements direct how code branches or repeats. Java's control flow looks like C's, but with modern additions like JDK 14+'s **switch expression**.
05. Methods
Basics · Prerequisite: previous lecture
A method is "a named bundle of code." Extracting repeated work into a method improves both readability and reuse. This lecture covers method declaration, overloading, the meaning of `static`, and varargs (`...`).
OOP
5 lessons · classes · encapsulation · inheritance · polymorphism · interfaces
06. Classes and Objects
OOP · Prerequisite: previous lecture
Java is an object-oriented (OOP) language. You define data with a **class** and stamp out **objects (instances)** from that blueprint. This lecture covers defining a class and using its fields and methods through objects.
07. Encapsulation
OOP · Prerequisite: previous lecture
Encapsulation is the OOP principle of hiding an object's **state (fields)** behind methods (getters/setters or domain methods). It prevents the object from being broken by invalid values and gives you room to change the implementation later.
08. Inheritance
OOP · Prerequisite: previous lecture
Inheritance lets a child class **reuse and extend** the parent's structure and behavior with the `extends` keyword. This lecture covers `extends`, `super`, the `@Override` annotation, and method overriding.
09. Polymorphism
OOP · Prerequisite: previous lecture
Polymorphism means a **parent reference can point to a child object**, and the method actually called is decided at runtime. Together with `abstract` classes, it's the backbone of flexible OOP design.
10. Interfaces
OOP · Prerequisite: previous lecture
An **interface** declares behavior to be implemented. A class implements one or more interfaces with `implements`. Since JDK 8 interfaces can carry `default` and `static` methods too — the underpinning of the Stream and functional APIs.
Collections & Generics
4 lessons · arrays · List/Set/Map · generics · Stream
11. Arrays
Collections & Generics · Prerequisite: previous lecture
An **array** is the most basic data structure for accessing values of the same type by **contiguous index**. Its size is fixed once allocated, but it's fast and memory-efficient.
12. List, Set & Map in Java
List vs Set vs Map · ArrayList · HashSet · HashMap
The three most-used interfaces of the Java Collections Framework: **List** (ordered, allows duplicates), **Set** (unique elements), **Map** (key-value pairs). This lecture covers the typical implementations: `ArrayList`, `HashSet`, `HashMap`.
13. Generics and Wildcards
Collections & Generics · Prerequisite: previous lecture
Generics make collections and methods **type-safe and reusable**. This lecture covers generic classes / methods, the wildcards `?`, `? extends`, `? super`, and the limits caused by type erasure.
14. Stream API Introduction
Collections & Generics · Prerequisite: previous lecture
The Stream API (JDK 8+) lets you express collection operations **declaratively**. This lecture covers `filter` / `map` / `reduce`, intermediate vs terminal operations, and `Collectors`.
Exceptions & I/O
3 lessons · exceptions · file I/O · strings
15. Exception Handling
Exceptions & I/O · Prerequisite: previous lecture
Exceptions are objects that represent **errors at runtime**. This lecture covers `try` / `catch` / `finally`, the difference between checked and unchecked exceptions, custom exceptions, and try-with-resources.
16. File I/O and NIO.2
Exceptions & I/O · Prerequisite: previous lecture
Read and write files with the modern NIO.2 API (`java.nio.file.*`). Covers `Path`, `Files.readString` / `writeString`, line-based reads, and the difference with the legacy `java.io.File`.
17. Strings and Text Blocks
Exceptions & I/O · Prerequisite: previous lecture
String manipulation, the `StringBuilder` for efficient mutation, multi-line text blocks (JDK 15+), and `String.format` / `formatted`.
Modern Java
5 lessons · lambda · Optional · Date/Time · Maven/Gradle · JUnit
18. Lambdas and Functional Interfaces
Modern Java · Prerequisite: previous lecture
A **lambda** is a concise **anonymous function**. Since JDK 8 it's the core syntax you see everywhere — collections, Stream, Spring. This lecture also covers method references and the standard functional interfaces (`Function` / `Predicate` / `Consumer` / `Supplier`).
19. Optional
Modern Java · Prerequisite: previous lecture
`Optional<T>` is a container that **encodes "maybe a value, maybe none" in the type**. Using it as a return type for methods that might return null forces callers to handle the empty case and reduces NPEs.
20. Dates and Times (java.time)
Modern Java · Prerequisite: previous lecture
Java's standard date/time API was overhauled in JDK 8 into the `java.time` package — immutable, semantically clear, with proper time-zone support. Far easier to use than the legacy `Date` / `Calendar`.
21. Maven and Gradle
Modern Java · Prerequisite: previous lecture
Until now we've compiled `.java` files by hand with `javac` / `java`. Real projects use a **build tool** to automate dependencies, compilation, testing, and packaging. Java's two main build tools are **Maven** and **Gradle**.
22. JUnit 5 Unit Testing
Modern Java · Prerequisite: previous lecture
Saying "the code works" requires **verification**. JUnit 5 is the de-facto standard test framework for Java, with a concise annotation-driven API.
Spring Boot
4 lessons · setup · REST · service layer · JPA
23. Getting Started with Spring Boot
Spring Boot · Prerequisite: previous lecture
Spring Boot lives by **convention over configuration** — you get an **immediately-runnable web app** without dozens of XML lines. It bundles an embedded Tomcat, so `java -jar` launches a server in one line.
24. REST API and @RestController
Spring Boot · Prerequisite: previous lecture
REST APIs manipulate resources via HTTP methods (`GET` / `POST` / `PUT` / `DELETE`) and URLs. Spring Boot makes this trivial with `@RestController` and the various mapping annotations.
25. Services and Dependency Injection
Spring Boot · Prerequisite: previous lecture
For small examples one controller class is fine, but as a project grows **separating concerns** is crucial for maintainability. This lecture covers Spring's conventional 3-layer architecture and the **DTO** pattern for safe data transfer between layers.
26. Spring Data JPA and H2
Spring Boot · Prerequisite: previous lecture
Until now we used in-memory `Map`s. Now we add a **persistence layer** with **Spring Data JPA** and the **H2 in-memory database** so data survives between calls. JPA is the ORM standard that automates the mapping between Java objects and SQL.