JvJava

Learn Java – all lessons

16 lessons from beginner to advanced, building on each other and with code examples.

Beginner
1

Hello World, main & Running

Structure of a Java program, output and comments.

2

Variables & Data Types

Primitive types, String, var, conversion and typical number pitfalls.

3

Conditions, if & switch

Making decisions – including the modern switch expression.

4

Loops

for, for-each, while and do-while.

5

Methods

Reusable building blocks: parameters, return values, overloading, varargs.

6

Arrays, Lists, Maps & Sets

The most important data structures of the Collections Framework.

Intermediate
7

Strings, StringBuilder & Text Blocks

Processing and formatting text and writing multi-line text cleanly.

8

Classes, Inheritance & Interfaces

Object orientation: encapsulation, constructors, inheritance, abstract classes, interfaces.

9

Records & Enums

Immutable data classes without boilerplate and fixed sets of values.

10

Exceptions & Files

Catching errors, try-with-resources and reading and writing files with java.nio.

11

Lambdas & Streams

Declaratively filtering, transforming, grouping and summarizing data.

12

Optional & Generics

Handling null safely and writing type-safe, reusable classes and methods.

Advanced
13

sealed, Pattern Matching & Record Patterns

Closed type hierarchies and expressive case distinctions checked by the compiler.

14

Concurrency & Virtual Threads

Threads, ExecutorService, CompletableFuture, atomics and virtual threads (Java 21).

15

JVM, Memory & Garbage Collection

How Java code runs, where objects live and typical reference pitfalls.

16

Build Tools, Modules & JUnit

Maven/Gradle, dependencies, JAR files and testing with JUnit 5.