Java Learning Path: Start Here
In short: you learn core Java in 7 milestones, building one small, tested project in each. Then you move on to the SDET track, where Java is used most on this site.
Read this page once to see the plan. Then, for each milestone, follow the same four steps: learn โ build โ test โ commit. Come back here whenever you're unsure what to do next.
The pages in this learning pathโ
In short: each page has one job, so nothing is explained twice.
| Page | What it's for | When to open it |
|---|---|---|
| This roadmap | The plan: what each milestone covers and how to check yourself | At the start of each milestone |
| Java cheat sheet | Learn each idea: short explanation, example, exercise | The "learn" step of every milestone |
| Milestones & Mini-Projects | A full working project with tests for each milestone | The "build" and "test" steps |
| Quick Reference | Look up syntax and library calls | Any time you're coding |
| Coding Best Practices | Habits that keep code clean and safe | After Milestone 5, then before every commit |
| Java: The Complete Guide | JVM internals and interview questions | When you want the deeper "why" |
Part 1 โ Core Java: Milestones 1โ7โ
In short: everyone does these seven, in order. Each one ends with a working project in your portfolio.
| Milestone | You learn | You build |
|---|---|---|
| 1 | Setup, types, text, switch, methods | Temperature converter |
| 2 | Lists, sets, maps, sorting | Word counter |
| 3 | Loops, conditions, exceptions | Password validator |
| 4 | Generics, lambdas, functional interfaces | Retry helper |
| 5 | Classes, inheritance, interfaces, records, enums | Bank accounts |
| 6 | Streams, Optional, files | Log analyzer |
| 7 | Build tools, JUnit, concurrency | Concurrent health checker |
For each milestone:
- Learn โ read the cheat-sheet sections listed for that milestone below.
Type the examples into
jshell. - Build โ follow its project in Milestones & Mini-Projects. Type the code; don't paste it.
- Test โ run
mvn testuntil everything passes. Then do the project's Try it. - Commit โ save your progress with git:
git add .
git commit -m "Milestone 1: temperature converter, 8 tests passing"
git push
Milestone 1: Getting startedโ
Learn: Your first program ยท Variables & types ยท Text & numbers ยท Making decisions & loops ยท Methods
Build: Temperature converter
Check yourself:
- What's the difference between
intandInteger? - Why does
7 / 2give3, and how do you get3.5? - What does
staticmean on a method?
Milestone 2: Collectionsโ
Learn: Arrays & lists ยท Sets, maps & queues ยท Quick Reference: Sorting
Build: Word counter
Check yourself:
- When would you pick a
HashSetover anArrayList? - What does
map.merge(key, 1, Integer::sum)do when the key is missing? - How do you sort by one field, then another?
Milestone 3: Control flow & errorsโ
Learn: Handling errors ยท Reading & writing files ยท Common mistakes
Build: Password validator
Check yourself:
- What's the difference between a checked and an unchecked exception?
- Why should you compare strings with
equals, not==? - What does
try-with-resources do for you?
Milestone 4: Generics & lambdasโ
Build: Retry helper
Check yourself:
- What does the
<T>instatic <T> T first(List<T> items)mean? - Name three functional interfaces and what each takes and returns.
- Why can't a lambda change a local variable from outside it?
Milestone 5: Object-oriented designโ
Learn: Classes & objects ยท Records ยท Inheritance & interfaces ยท equals, hashCode & toString ยท Enums & switch patterns
Build: Bank accounts
Then read: Coding Best Practices, sections 1โ5.
Check yourself:
- When would you use an
interface, anabstract class, and arecord? - What goes wrong if you override
equalsbut nothashCode? - Why store money as
longcents instead ofdouble?
Milestone 6: Streams & filesโ
Learn: Streams ยท Optional ยท Immutability ยท Quick Reference: Collectors, Files
Build: Log analyzer
Check yourself:
- Why does nothing happen until a stream's last step?
- What does
groupingByreturn? - When should a method return
Optional, and when an empty list?
Milestone 7: Build, test & concurrencyโ
Learn: Build tools ยท Testing with JUnit ยท Threads & thread pools ยท Sharing data safely ยท CompletableFuture ยท The JVM & memory
Build: Concurrent health checker
Check yourself:
- What's a race condition, and name two ways to prevent one?
- When are virtual threads a good fit, and when aren't they?
- How did putting the network call behind an interface make the tests possible?
Part 2 โ Your role track: Milestone 8 onwardsโ
In short: on this site Java is taught for SDET work (Software Development Engineer in Test) โ building automated tests and test frameworks.
| Step | Read | You build |
|---|---|---|
| 8 | Java for SDET, sections 2โ6: unit tests, fixtures, data-driven tests, mocks, API tests | Tests for your Milestone 5 and 7 projects |
| 9 | Java for SDET, sections 7โ12: page objects, waits, test data builders, tags, reports, CI | A small UI test framework that runs in CI |
| 10 | Tool guides: JUnit, TestNG, Rest Assured, Selenium | Pick the tools your team uses |
| Final | Java for SDET: practice projects | A full test automation suite running in CI (Continuous Integration) |
Working as an SDE or SRE? The same Milestones 1โ7 apply; then use Java: The Complete Guide for the deeper language topics.
Your portfolioโ
In short: by Milestone 7 you'll have seven small, tested projects in one GitHub repository.
java-mastery/
โโโ pom.xml
โโโ README.md # one line per milestone: what it does, how to run it
โโโ src/
โโโ main/java/com/example/m1 โฆ m7/
โโโ test/java/com/example/m1 โฆ m7/
Your role track then adds one larger final project.
How you know you're ready to move onโ
After Milestone 7:
- All seven projects built;
mvn testpasses. - You can explain when to use a
List,Set, orMap. - You can read a file, handle errors, and test both the good and bad paths.
- Your git history shows steady progress.
After your role track:
- You finished the final project, and it runs in CI.
- You can explain the design choices in it to someone else.
If you get stuckโ
| Problem | What to do |
|---|---|
| The code won't compile | Read the first error only โ later ones are often caused by it. The line number and ^ marker point at the problem. |
mvn test finds no tests | Test classes must end in Test, sit under src/test/java, and use org.junit.jupiter.api.Test. |
| A milestone feels too hard | Re-read its cheat-sheet sections, and run each example on its own in jshell. |
| "I already know Java" | Still do Milestones 1โ7, but do every Try it and add more tests. |
| Not enough time | Do less, but regularly. One milestone done well beats four rushed. |
Start nowโ
Install an LTS (Long-Term Support) JDK โ Java 21 or 25 โ and Maven, then create the project from Project setup.
java -version # should say 21 or higher
mvn -version
mkdir -p ~/projects/java-mastery && cd ~/projects/java-mastery
git init
jshell # try a few lines, then /exit
Helpful tools:
| Tool | What it does |
|---|---|
| IntelliJ IDEA Community | Free editor with Java-aware hints and a test runner |
jshell | Try any snippet instantly |
SDKMAN! (sdk install java) | Install and switch between Java versions |
Good books to read alongside: Effective Java (Joshua Bloch) for idiomatic Java, and The Pragmatic Programmer (Hunt & Thomas) for professional habits.