Skip to main content

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.

How to use this page

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.

PageWhat it's forWhen to open it
This roadmapThe plan: what each milestone covers and how to check yourselfAt the start of each milestone
Java cheat sheetLearn each idea: short explanation, example, exerciseThe "learn" step of every milestone
Milestones & Mini-ProjectsA full working project with tests for each milestoneThe "build" and "test" steps
Quick ReferenceLook up syntax and library callsAny time you're coding
Coding Best PracticesHabits that keep code clean and safeAfter Milestone 5, then before every commit
Java: The Complete GuideJVM internals and interview questionsWhen 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.

MilestoneYou learnYou build
1Setup, types, text, switch, methodsTemperature converter
2Lists, sets, maps, sortingWord counter
3Loops, conditions, exceptionsPassword validator
4Generics, lambdas, functional interfacesRetry helper
5Classes, inheritance, interfaces, records, enumsBank accounts
6Streams, Optional, filesLog analyzer
7Build tools, JUnit, concurrencyConcurrent health checker

For each milestone:

  1. Learn โ€” read the cheat-sheet sections listed for that milestone below. Type the examples into jshell.
  2. Build โ€” follow its project in Milestones & Mini-Projects. Type the code; don't paste it.
  3. Test โ€” run mvn test until everything passes. Then do the project's Try it.
  4. 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 int and Integer?
  • Why does 7 / 2 give 3, and how do you get 3.5?
  • What does static mean 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 HashSet over an ArrayList?
  • 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โ€‹

Learn: Generics ยท Lambdas

Build: Retry helper

Check yourself:

  • What does the <T> in static <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, an abstract class, and a record?
  • What goes wrong if you override equals but not hashCode?
  • Why store money as long cents instead of double?

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 groupingBy return?
  • 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.

StepReadYou build
8Java for SDET, sections 2โ€“6: unit tests, fixtures, data-driven tests, mocks, API testsTests for your Milestone 5 and 7 projects
9Java for SDET, sections 7โ€“12: page objects, waits, test data builders, tags, reports, CIA small UI test framework that runs in CI
10Tool guides: JUnit, TestNG, Rest Assured, SeleniumPick the tools your team uses
FinalJava for SDET: practice projectsA 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 test passes.
  • You can explain when to use a List, Set, or Map.
  • 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โ€‹

ProblemWhat to do
The code won't compileRead the first error only โ€” later ones are often caused by it. The line number and ^ marker point at the problem.
mvn test finds no testsTest classes must end in Test, sit under src/test/java, and use org.junit.jupiter.api.Test.
A milestone feels too hardRe-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 timeDo 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:

ToolWhat it does
IntelliJ IDEA CommunityFree editor with Java-aware hints and a test runner
jshellTry 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.