Learn Java by doing. Work through the lessons in order to go from compiling your first file to writing classes, handling exceptions, working with collections and streams, files, concurrency, databases, logging, and testing. Awareness-only topics have been stripped out so every lesson has you writing code.
Running Java Code & JShell
Compile and run your first Java program, experiment line by line in JShell, and understand the main method that every program starts from.
Variables, Data Types & Type Casting
Declare typed variables, learn Java’s primitive types versus objects, understand scope, and convert between types safely with casting.
Strings & Math Operations
Build and transform text with String methods, format output, and do calculations with operators and the Math class.
Arrays
Create fixed-size arrays, read and change elements by index, loop over them, and use Arrays helpers for sorting and printing.
Conditionals & Loops
Make decisions with if/else and switch, and repeat work with for, while, and do-while loops — including break and continue.
Classes & Objects
Define your own types with fields, constructors, and methods, control access with modifiers, and understand static, final, and packages.
Inheritance, Abstraction & Interfaces
Share behaviour with inheritance, override and overload methods, hide detail with abstract classes, and define contracts with interfaces.
Enums, Records & Nested Classes
Model fixed sets of values with enums, write concise immutable data carriers with records, and group helper types using nested classes.
Exception Handling
Catch and handle errors with try/catch/finally, clean up resources automatically, throw your own exceptions, and know checked from unchecked.
Generics & Collections
Store and look up data with List, Set, Map, and the Deque, and use generics so collections stay type-safe.
Lambdas, Functional Interfaces & the Stream API
Pass behaviour as values with lambdas and functional interfaces, then filter, map, and reduce collections cleanly with streams.
Optionals
Replace error-prone null with Optional to signal "maybe no value" and handle the missing case explicitly and safely.
File & I/O Operations
Read and write files with the modern java.nio API, append text, check existence, and read input from the console.
Date & Time
Work with dates, times, durations, and formatting using the modern, immutable java.time API.
Regular Expressions
Search, match, and replace text patterns with Java’s Pattern and Matcher classes — the practical patterns you’ll actually use.
Concurrency: Threads & Virtual Threads
Run work in parallel with threads, coordinate it with ExecutorService, and scale to thousands of tasks with lightweight virtual threads.
Database Access with JDBC
Connect to a database, run queries safely with PreparedStatement, read results, and manage transactions using core JDBC.
Logging with SLF4J & Logback
Replace System.out with structured logging — wire up SLF4J and Logback, use log levels, and add context with placeholders.
Testing with JUnit & Mockito
Write automated tests with JUnit 5, assert expected results, run parameterized cases, and isolate code from dependencies using Mockito.
Build Tools: Maven & Gradle
Manage dependencies, compile, test, and package your app into a runnable JAR using Maven or Gradle instead of raw javac.
Documentation with Javadoc
Document your classes and methods with Javadoc comments and generate a browsable HTML API reference with the javadoc tool.
What to learn next
This course covers the Java language itself. To build real web APIs and backend services, your next step is to learn Spring Boot — the most widely used Java framework for REST APIs, dependency injection, and database access. Finish Java first, then pick up Spring Boot.