Java
Modern Java 25 LTS from your first line of code to tested, database-backed applications, with the JDK, build tools, and JVM underneath never hidden.
Free to read now, no account needed: Before you start: programs, files, and the terminal. Create a free account to open the other chapters, take the quizzes and keep your progress.
My setup
Lessons that differ by operating system or tool show your choice first, and fold away notes meant for other setups. You can switch tabs in any lesson β it remembers what you pick.
Operating system
Environment
Build tool
Database
Part 1
Java development fundamentals
Chapters 0–2
›
1 Getting started with modern Java π
Create a free account to open this chapter.
- What Java is today ~20 min
- Where Java runs ~15 min
- JDK distributions and how to choose one ~20 min
- Install a JDK ~30 min
- Your first program ~30 min
- javac, java and the source launcher ~25 min
- Source to bytecode to the JVM ~25 min
- Try it in jshell ~20 min
- Reading your first error ~30 min
2 Java development tools π
Create a free account to open this chapter.
- What an IDE does for you ~20 min
- Create and run a project ~30 min
- Code completion, navigation and refactoring ~25 min
- The debugger, first look: breakpoints and stepping ~30 min
- Choosing and switching JDKs ~30 min
- Git: save your work ~35 min
- Maven and Gradle: what a build tool is for ~35 min
Part 2
Java programming fundamentals
Chapters 3–6
›
3 Language fundamentals π
Create a free account to open this chapter.
- Program structure ~35 min
- Variables, constants and var ~35 min
- Primitive types and literals ~35 min
- Reference types and null ~30 min
- Integer arithmetic ~35 min
- Floating-point arithmetic ~35 min
- Booleans, comparisons and logic ~35 min
- char and Unicode ~30 min
- Conversions and casting ~40 min
- Operators, precedence and scope ~40 min
4 Control flow and input π
Create a free account to open this chapter.
- Output and formatting ~40 min
- Console input ~45 min
- Command-line arguments ~35 min
- if and else ~40 min
- switch statements and switch expressions ~40 min
- while and do-while ~45 min
- for and enhanced for ~45 min
- break, continue and loop design ~60 min
- A first look at pattern-matching switch ~30 min
5 Strings, arrays, and basic data processing π
Create a free account to open this chapter.
- Strings are immutable objects ~25 min
- Searching, slicing, and transforming text ~40 min
- Comparing strings ~30 min
- Formatting and text blocks ~30 min
- StringBuilder ~30 min
- Arrays ~40 min
- Traversal patterns: count, sum, min/max, search ~40 min
- Sorting and binary search ~40 min
- Multidimensional arrays ~35 min
- Processing a small data file ~50 min
6 Methods and program design π
Create a free account to open this chapter.
- Defining and calling methods ~40 min
- Parameters and return values ~50 min
- Overloading and varargs ~45 min
- Scope and the call stack ~45 min
- Pass-by-value and references ~60 min
- Recursion ~55 min
- Decomposition and stepwise refinement ~50 min
- Designing and testing methods ~60 min
Part 3
Object-oriented Java
Chapters 7–9
›
7 Classes and objects π
Create a free account to open this chapter.
- Classes, objects and references ~45 min
- Fields and methods: state and behavior ~45 min
- Constructors and this ~55 min
- Access modifiers and encapsulation ~50 min
- Validation and invariants ~50 min
- Getters, setters and when not to write them ~50 min
- static members ~50 min
- toString, equals and hashCode ~60 min
- Designing a class from a specification ~60 min
8 Inheritance, interfaces, and polymorphism π
Create a free account to open this chapter.
- Inheritance, extends and super ~55 min
- Overriding and dynamic dispatch ~60 min
- Abstract classes ~45 min
- Interfaces ~55 min
- Default and static interface methods ~50 min
- Functional interfaces, first look ~45 min
- instanceof and type patterns ~50 min
- Composition versus inheritance: when to use which ~60 min
9 Modern Java object modeling π
Create a free account to open this chapter.
- Enums with fields and behavior ~55 min
- Records ~55 min
- Immutability and value-oriented design ~55 min
- Sealed classes and interfaces ~50 min
- Record patterns and exhaustive switch ~60 min
- Data-transfer objects ~45 min
- Modeling a domain: from verbose Java to modern Java ~70 min
Part 4
Collections and modern Java
Chapters 10–11
›
10 Collections and generics π
Create a free account to open this chapter.
- The collections framework ~50 min
- List and ArrayList ~55 min
- Sets and their three implementations ~55 min
- Maps from keys to values ~60 min
- Queues, deques and priority queues ~55 min
- Immutable and sequenced collections ~55 min
- Iteration and modification ~50 min
- Choosing a collection ~60 min
- Generic classes and methods ~55 min
- Bounds, wildcards and PECS ~60 min
- Type erasure ~50 min
11 Lambdas, functional programming, and streams π
Create a free account to open this chapter.
- Lambdas and functional interfaces ~50 min
- Method references ~45 min
- Predicate, Function, Consumer and Supplier ~55 min
- Stream pipelines ~60 min
- flatMap and reduce ~55 min
- Collectors, grouping and partitioning ~60 min
- Optional ~50 min
- Loops or streams? ~55 min
Part 5
Errors, files, and data
Chapters 12–13
›
12 Exceptions and error handling π
Create a free account to open this chapter.
- What an exception is ~45 min
- try, catch and finally ~55 min
- Checked and unchecked exceptions ~50 min
- throw, throws and propagation ~55 min
- Custom exceptions and wrapping ~55 min
- try-with-resources ~50 min
- Good error messages and a handling strategy ~55 min
- Debugging from a stack trace ~55 min
13 Files, I/O, dates, and data π
Create a free account to open this chapter.
- Path and Files ~50 min
- Reading and writing text files ~55 min
- Directories and walking a tree ~50 min
- Byte streams, character streams and buffering ~50 min
- Serialization concepts ~40 min
- JSON with Jackson ~60 min
- java.time: dates, times and instants ~55 min
- Time zones, formatting and parsing ~60 min
Part 6
Building real Java applications
Chapters 14–16
›
14 Maven, Gradle, dependencies, and project structure π
Create a free account to open this chapter.
- What a build tool actually does ~45 min
- The standard project layout ~40 min
- Maven and the pom.xml ~50 min
- The Maven lifecycle: compile, test, package ~50 min
- Dependencies, scopes and repositories ~55 min
- Transitive dependencies and version conflicts ~55 min
- Plugins and JAR creation ~55 min
- Gradle and the Kotlin DSL ~55 min
15 Testing and code quality π
Create a free account to open this chapter.
- Why test ~45 min
- JUnit tests and assertions ~60 min
- Parameterized tests ~50 min
- Organizing tests ~55 min
- Test doubles and Mockito ~60 min
- Integration tests and Testcontainers ~55 min
- Code coverage ~50 min
- Formatting and static analysis ~50 min
16 Debugging and professional development π
Create a free account to open this chapter.
- Compiler errors, runtime exceptions and logic errors ~45 min
- The debugger in depth ~55 min
- Logging with SLF4J and Logback ~50 min
- Configuration and environment variables ~45 min
- .gitignore and a Git workflow ~50 min
- Branches, merges and pull requests ~55 min
Part 7
Databases and networking
Chapters 17–19
›
17 Databases and JDBC π
Create a free account to open this chapter.
- Relational databases ~45 min
- SQL fundamentals ~70 min
- Connecting with JDBC ~55 min
- Prepared statements and result sets ~65 min
- Transactions ~55 min
- Connection pools ~40 min
- JPA, Jakarta Persistence and Hibernate ~65 min
- JDBC or ORM? ~35 min
18 Networking, HTTP, and REST APIs π
Create a free account to open this chapter.
- Networking fundamentals ~45 min
- HTTP: URLs, methods, status codes and headers ~60 min
- REST and JSON APIs ~60 min
- HttpClient: synchronous requests ~60 min
- Asynchronous requests ~50 min
- Building an API client ~60 min
- Authentication concepts ~55 min
19 Building web applications π
Create a free account to open this chapter.
- The Java backend landscape: Spring Boot and Jakarta EE ~45 min
- Dependency injection ~55 min
- Controllers and REST endpoints ~60 min
- Services and repositories ~55 min
- Configuration and profiles ~50 min
- Validation and error responses ~60 min
- Database integration with Spring Data ~65 min
Part 8
Concurrency and the JVM
Chapters 20–21
›
20 Threads and concurrency π
Create a free account to open this chapter.
- Processes and threads ~35 min
- Creating threads and Runnable ~45 min
- Race conditions ~45 min
- synchronized, locks and volatile ~55 min
- Atomic variables and concurrent collections ~55 min
- Deadlock ~50 min
- Executors, thread pools and Future ~55 min
- CompletableFuture ~55 min
- Virtual threads ~55 min
- Structured concurrency and scoped values ~50 min
21 The JVM, memory, and performance π
Create a free account to open this chapter.
- Bytecode and javap ~40 min
- Class loading and initialization ~40 min
- Stack, heap and references ~40 min
- Garbage collection ~45 min
- The JIT compiler ~40 min
- Boxing, allocation and common costs ~45 min
- Profiling with JDK Flight Recorder ~40 min
- Benchmarking with JMH ~50 min
Part 9
Packaging and professional Java
Chapters 22–24
›
22 Packages, modules, and application distribution π
Create a free account to open this chapter.
- Packages, imports, and package visibility ~40 min
- JAR files and manifests ~35 min
- The class path ~40 min
- Modules and module-info.java ~45 min
- The module path, and when modules are worth it ~40 min
- jlink and custom runtimes ~35 min
- jpackage and distributing an application ~40 min
23 Java design and architecture π
Create a free account to open this chapter.
- DRY, KISS and separation of concerns ~50 min
- The SOLID principles ~60 min
- Composition, immutability and dependency inversion ~55 min
- Layered architecture ~55 min
- Creational patterns: factory and builder ~55 min
- Behavioral patterns: strategy and observer ~60 min
- Structural patterns: adapter and decorator ~60 min
24 Security and modern Java practice π
Create a free account to open this chapter.
- Input validation ~60 min
- SQL injection ~55 min
- Authentication and authorization ~60 min
- Passwords and secrets ~65 min
- Secure HTTP and TLS ~50 min
- Dependency vulnerabilities ~55 min
- Deserialization risks ~55 min
- Modern Java practice and legacy code ~50 min
Part 10
Capstone
Chapters 25–25
›
25 Building a complete Java application π
Create a free account to open this chapter.
- The project and its requirements ~45 min
- Designing the domain ~55 min
- Persistence and files ~55 min
- The HTTP API ~60 min
- Tests and logging ~50 min
- Build, package and document ~50 min
- Review against the checklist ~45 min
Appendices
Reference chapters on the tools the course uses. Dip in when a lab or a section sends you here; they are not part of the course exam.
A Appendix A: Legacy and existing code π
Create a free account to open this chapter.
- Language and collections before modern Java ~40 min
- I/O, dates and concurrency the old way ~40 min
- Java EE and the move from javax to jakarta ~35 min
- Upgrading to modern Java ~40 min
B Appendix B: Java version map π
Create a free account to open this chapter.
- Releases, LTS and support ~30 min
- Features by release ~35 min