CodeBlanks Logo Icon CodeBlanks
Free 4 levels Java

Java

Learn modern Java 21 from variables to OOP, lambdas, streams and expert topics with hands-on projects.

The Java course covers all levels with variables, OOP, inheritance, lambdas, the Stream API, JUnit, multithreading, JVM internals and bytecode. Each level ends with projects and challenges.

  • 360 lessons
  • 29 h 30 min
  • 12 projects

No account needed, you can start right away. To save your progress, create a free account

Levels

The Java course goes from zero to expert in four levels. Start at any level you like.
Not sure of your level? Take the placement test
Beginner

Learn Java 21 fundamentals: the main method, variables, data types, loops, arrays, collections, methods and exception basics.

  • Java basics
  • Variables
  • Data types
  • Operators
116 lessons · 8 h 46 min See lessons →
Intermediate

Learn classes, inheritance, encapsulation, interfaces, abstract classes, file I/O, serialization, generics and lambda with stream basics in Java.

  • Classes
  • Constructor
  • Inheritance
  • Encapsulation
116 lessons · 9 h 44 min See lessons →
Advanced

Learn advanced stream, Optional, functional interfaces, java.time, reflection, annotations, design patterns, JUnit, Mockito, multithreading and the concurrent API in Java.

  • Advanced stream
  • Optional
  • Functional interface
  • Date/time API
82 lessons · 7 h 0 min See lessons →
Expert

Learn JVM internals, memory model, NIO, reactive, JNI, performance and GC tuning, bytecode and microservice basics in Java.

  • JVM internals
  • Memory model
  • NIO
  • Reactive
46 lessons · 4 h 0 min See lessons →

Projects you will build

At every level you combine what you learned into a real page.

How does it work?

Short explanation

Each lesson explains one concept in a few short cards; no long videos or walls of text.

Try it right away

Multiple choice, fill-in-the-blank and matching exercises lock in what you just learned.

Write it yourself

You write real code in the in-browser editor; it is checked instantly and you see the result live.

Curriculum

62 groups · 360 lessons · 29 h 30 min

Learn Java 21 fundamentals: the main method, variables, data types, loops, arrays, collections, methods and exception basics.

1
Java basics
6 lessons · 24 min
  1. 1 What is Java? Learn that Java is a compiled, object-oriented and platform-independent language. 4 min
  2. 2 The main method Learn main(String[] args) and printing with System.out.println. 4 min
  3. 3 Comments Learn single-line (//) and multi-line (/* */) comments. 3 min
  4. 4 Class skeleton Learn the public class and static method structure. 4 min
  5. 5 javac and java Learn to compile and run from the command line. 4 min
  6. 6 Summary - Java basics Combine main, comments and the class skeleton to write your first Java program. 5 min
2
Variables
6 lessons · 24 min
  1. 1 int and double Learn numeric variables with int and double. 4 min
  2. 2 boolean Learn true/false values with boolean. 3 min
  3. 3 String Learn text variables with String. 4 min
  4. 4 Naming variables Learn camelCase and valid naming rules. 4 min
  5. 5 final variables Learn constant-value variables with final. 4 min
  6. 6 Summary - Variables Combine int, double and String to write a profile card. 5 min
3
Data types
6 lessons · 26 min
  1. 1 Primitive types Learn primitives byte, short, int, long, float, double, char, boolean. 4 min
  2. 2 Type casting Learn type casting with (int), (double). 4 min
  3. 3 String concatenation Learn text joining with +. 4 min
  4. 4 Math class Learn math operations with Math.abs and Math.max. 4 min
  5. 5 BigInteger and BigDecimal Learn precise calculations with big numbers. 5 min
  6. 6 Summary - Data types Combine primitives, Math and BigDecimal to write an interest calculator. 5 min
4
Project: CalculatorProject
5 lessons · 30 min
  1. 1 Project design Design the calculator class skeleton. 6 min
  2. 2 Add/subtract Write add and subtract methods. 6 min
  3. 3 Multiply/divide Add multiply, divide and zero check. 6 min
  4. 4 Error handling Catch invalid inputs with try/catch. 6 min
  5. 5 Putting it together Write a working calculator with a menu loop. 6 min
5
Operators
6 lessons · 25 min
  1. 1 Arithmetic Learn +, -, *, /, % operators. 4 min
  2. 2 Comparison Learn ==, !=, <, >, <=, >= operators. 4 min
  3. 3 Logical Learn boolean logic with &&, ||, !. 4 min
  4. 4 Bitwise Learn &, |, ^, ~, <<, >> bitwise operators. 4 min
  5. 5 Assignment and increment Learn =, +=, ++, -- assignment and increment operators. 4 min
  6. 6 Summary - Operators Combine arithmetic, comparison and logical operators to write a grade calculator. 5 min
6
String basics
6 lessons · 25 min
  1. 1 length and charAt Learn string access with length() and charAt(). 4 min
  2. 2 equals and equalsIgnoreCase Learn string comparison with equals(). 4 min
  3. 3 indexOf and substring Learn searching and slicing with indexOf() and substring(). 4 min
  4. 4 toUpperCase and trim Learn transformations with toUpperCase() and trim(). 4 min
  5. 5 String.format Learn formatting with String.format(). 4 min
  6. 6 Summary - String basics Combine length, substring and format to write a business card. 5 min
7
Conditionals
6 lessons · 25 min
  1. 1 The if statement Learn condition checks with if. 4 min
  2. 2 else and else if Learn alternatives with else and else if. 4 min
  3. 3 Nested if Learn nested if blocks. 4 min
  4. 4 switch Learn multi-branch with switch. 4 min
  5. 5 Ternary Learn single-line conditionals with ? :. 4 min
  6. 6 Summary - Conditionals Combine if, else if, switch and ternary to write a day-of-week app. 5 min
8
Loops
6 lessons · 24 min
  1. 1 The for loop Learn counting loops with for. 4 min
  2. 2 The while loop Learn conditional loops with while. 4 min
  3. 3 do-while Learn do-while loops that run at least once. 4 min
  4. 4 break and continue Learn to exit with break and skip with continue. 3 min
  5. 5 for-each Learn to iterate arrays and collections with for-each. 4 min
  6. 6 Summary - Loops Combine for, while and for-each to write a multiplication table. 5 min
9
Project: Shopping cartProject
5 lessons · 30 min
  1. 1 Cart design Design the shopping cart class skeleton. 6 min
  2. 2 Adding items Add items with addItem. 6 min
  3. 3 Calculating totals Compute subtotal and tax-inclusive total. 6 min
  4. 4 Updating quantity Manage cart with updateQuantity and removeItem. 6 min
  5. 5 Putting it together Combine the cart class with a menu loop. 6 min
10
Arrays
6 lessons · 25 min
  1. 1 Declaring arrays Learn to declare arrays with new int[n]. 4 min
  2. 2 Array access Learn access with arr[i] and length. 4 min
  3. 3 Filling arrays Learn to fill arrays with for. 4 min
  4. 4 Multi-dimensional arrays Learn matrices with int[][]. 4 min
  5. 5 Copying arrays Learn to copy with System.arraycopy. 4 min
  6. 6 Summary - Arrays Combine declaring, filling and matrices to write a class list. 5 min
11
Array methods
6 lessons · 26 min
  1. 1 Arrays.sort Learn sorting with Arrays.sort. 4 min
  2. 2 Arrays.toString Learn to print arrays with Arrays.toString. 4 min
  3. 3 Arrays.binarySearch Learn binary search with Arrays.binarySearch. 5 min
  4. 4 Arrays.copyOf Learn to copy with Arrays.copyOf. 4 min
  5. 5 Arrays.fill Learn to fill arrays with Arrays.fill. 4 min
  6. 6 Summary - Array methods Combine sort, binarySearch and toString to write a sorting tool. 5 min
12
Collections
6 lessons · 26 min
  1. 1 ArrayList Learn dynamic arrays with ArrayList. 4 min
  2. 2 add and get Learn collection operations with add() and get(). 4 min
  3. 3 HashMap Learn key-value mapping with HashMap. 5 min
  4. 4 put and get Learn map operations with put() and get(). 4 min
  5. 5 HashSet Learn unique-element sets with HashSet. 4 min
  6. 6 Summary - Collections Combine ArrayList, HashMap and HashSet to write a phone book. 5 min
13
Methods
6 lessons · 24 min
  1. 1 Defining methods Learn to define static methods. 4 min
  2. 2 return Learn to return values with return. 4 min
  3. 3 void methods Learn valueless methods with void. 3 min
  4. 4 Method overloading Learn same-named methods. 4 min
  5. 5 Scope Learn variable scope inside methods. 4 min
  6. 6 Summary - Methods Combine return, overloading and scope to write a math helper. 5 min
14
Method parameters
6 lessons · 26 min
  1. 1 Primitive parameters Learn to pass primitive parameters. 4 min
  2. 2 Object parameters Learn to pass object references. 4 min
  3. 3 varargs Learn flexible parameters with int.... 5 min
  4. 4 Multiple values via array Learn to return multiple values via an array. 4 min
  5. 5 final parameters Learn immutability with final parameters. 4 min
  6. 6 Summary - Method parameters Combine primitive, object and varargs to write a statistics function. 5 min
15
Project: To-do CLIProject
5 lessons · 30 min
  1. 1 Task model Design the Task class. 6 min
  2. 2 Adding tasks Add tasks with addTask. 6 min
  3. 3 Listing tasks Print tasks with listTasks. 6 min
  4. 4 Completing tasks Update status with completeTask. 6 min
  5. 5 Putting it together Write a CLI app with a menu loop. 6 min
16
String builder
6 lessons · 25 min
  1. 1 StringBuilder Learn mutable text with StringBuilder. 4 min
  2. 2 append Learn to add text with append. 4 min
  3. 3 insert and delete Learn to edit text with insert and delete. 4 min
  4. 4 reverse Learn to reverse text with reverse. 4 min
  5. 5 toString Learn to obtain a string with toString. 4 min
  6. 6 Summary - String builder Combine append, insert and reverse to write a report generator. 5 min
17
Input and output
6 lessons · 28 min
  1. 1 Scanner Learn to read input with Scanner. 4 min
  2. 2 nextInt and nextLine Learn type conversion with nextInt() and nextLine(). 5 min
  3. 3 System.out.printf Learn formatted output with printf. 4 min
  4. 4 BufferedReader Learn efficient reading with BufferedReader. 5 min
  5. 5 try-with-resources Learn resource management with try-with-resources. 5 min
  6. 6 Summary - Input and output Combine Scanner, printf and BufferedReader to write an interactive menu. 5 min
18
Enum
6 lessons · 25 min
  1. 1 Declaring enums Learn constant sets with enum. 4 min
  2. 2 values and valueOf Learn enum operations with values() and valueOf(). 4 min
  3. 3 Enum fields Learn to add fields to enum constants. 4 min
  4. 4 Enum methods Learn to define methods inside enums. 4 min
  5. 5 switch with enum Learn to use enums with switch. 4 min
  6. 6 Summary - Enum Combine values, methods and switch to write a seasons app. 5 min
19
Exception basics
6 lessons · 28 min
  1. 1 try/catch Learn to catch exceptions with try/catch. 5 min
  2. 2 finally Learn the finally block. 4 min
  3. 3 throw Learn to throw exceptions with throw. 4 min
  4. 4 Exception hierarchy Learn RuntimeException, IOException and others. 5 min
  5. 5 Multiple catch Learn multiple catch blocks. 5 min
  6. 6 Summary - Exception basics Combine try/catch/finally and throw to write a bank account class. 5 min
20
Beginner finalProject
5 lessons · 30 min
  1. 1 Project design Design the beginner final skeleton. 6 min
  2. 2 Data model Set up the data model and collections. 6 min
  3. 3 Business logic Write business rules with methods and conditions. 6 min
  4. 4 Error handling Add input validation with try/catch. 6 min
  5. 5 Putting it together Combine all parts into a working app. 6 min

Learn classes, inheritance, encapsulation, interfaces, abstract classes, file I/O, serialization, generics and lambda with stream basics in Java.

1
Classes
6 lessons · 26 min
  1. 1 class Learn to define classes with class. 5 min
  2. 2 Attributes Learn class and instance attributes. 4 min
  3. 3 Methods Learn methods and this inside a class. 4 min
  4. 4 new Learn to create objects with new. 4 min
  5. 5 toString Learn object representation with toString. 4 min
  6. 6 Summary - Classes Combine attributes and methods to write a User class. 5 min
2
Constructor
6 lessons · 28 min
  1. 1 Constructor basics Learn the class constructor method. 5 min
  2. 2 Parameterized constructor Learn constructors that take parameters. 5 min
  3. 3 Constructor overloading Learn multiple constructors in the same class. 4 min
  4. 4 this() Learn to call constructors with this(). 5 min
  5. 5 Default constructor Learn the compiler-provided default constructor. 4 min
  6. 6 Summary - Constructor Combine parameterized constructors and this() to write a Product class. 5 min
3
Inheritance
6 lessons · 29 min
  1. 1 extends Learn inheritance with extends. 5 min
  2. 2 super Learn to call the parent with super. 5 min
  3. 3 Method overriding Learn to override methods in derived classes. 4 min
  4. 4 Object class Learn the Object class and equals/hashCode. 5 min
  5. 5 final class and method Learn non-extendability with final. 5 min
  6. 6 Summary - Inheritance Combine super and override to write a shape hierarchy. 5 min
4
Project: LibraryProject
5 lessons · 30 min
  1. 1 Class design Design the library class skeleton. 6 min
  2. 2 Book model Write the Book class and constructor. 6 min
  3. 3 Member management Register members with Member. 6 min
  4. 4 Borrow flow Write borrow and return operations. 6 min
  5. 5 Putting it together Combine the library class with a menu loop. 6 min
5
Encapsulation
6 lessons · 28 min
  1. 1 private fields Learn field hiding with private. 4 min
  2. 2 Getter Learn accessor methods with getX. 5 min
  3. 3 Setter Learn mutator methods and validation with setX. 5 min
  4. 4 Package-private Learn package-level visibility. 4 min
  5. 5 Record Learn immutable data classes with record. 5 min
  6. 6 Summary - Encapsulation Combine private, getter and setter to write an Account class. 5 min
6
Static
6 lessons · 28 min
  1. 1 static fields Learn class-level state with static fields. 5 min
  2. 2 static methods Learn static methods and the Math example. 5 min
  3. 3 static block Learn class initialization with static blocks. 5 min
  4. 4 Class variables Learn to share class-level variables. 4 min
  5. 5 instanceof Learn type checks with instanceof. 4 min
  6. 6 Summary - Static Combine static fields, methods and blocks to write a Configuration class. 5 min
7
Constants
6 lessons · 27 min
  1. 1 static final Learn to define constants with static final. 4 min
  2. 2 Uppercase convention Learn the uppercase naming convention for constants. 4 min
  3. 3 Constants with enum Learn to define constant sets with enum. 5 min
  4. 4 Interface constants Learn to define constants inside interfaces. 5 min
  5. 5 Math constants Learn built-in constants like Math.PI. 4 min
  6. 6 Summary - Constants Combine static final and enum constants to write a unit conversion class. 5 min
8
Project: Quiz appProject
5 lessons · 30 min
  1. 1 Quiz model Design the Question and Quiz class skeleton. 6 min
  2. 2 Adding questions Add questions with addQuestion. 6 min
  3. 3 Running the quiz Ask questions in turn with run. 6 min
  4. 4 Score calculation Compute correct count and percentage with score. 6 min
  5. 5 Putting it together Combine the Quiz class with a menu loop. 6 min
9
Interface
6 lessons · 30 min
  1. 1 interface Learn to define contracts with interface. 5 min
  2. 2 implements Learn to fulfill contracts with implements. 5 min
  3. 3 default methods Learn default methods inside interfaces. 5 min
  4. 4 static methods Learn static methods inside interfaces. 5 min
  5. 5 Multiple interfaces Learn to implement multiple interfaces. 5 min
  6. 6 Summary - Interface Combine interface and default methods to write a payment system. 5 min
10
Abstract class
6 lessons · 29 min
  1. 1 abstract class Learn to define abstract classes. 5 min
  2. 2 abstract methods Learn abstract methods. 5 min
  3. 3 Abstract and concrete Learn concrete methods in abstract classes. 4 min
  4. 4 Abstract vs interface Learn the difference between abstract class and interface. 5 min
  5. 5 Sealed class Learn restricted inheritance with sealed classes. 5 min
  6. 6 Summary - Abstract class Combine abstract methods and sealed to write a geometry hierarchy. 5 min
11
Polymorphism
6 lessons · 29 min
  1. 1 Polymorphism basics Learn superclass reference with subclass object. 5 min
  2. 2 Dynamic binding Learn which method is called at runtime. 5 min
  3. 3 Override rules Learn @Override and its rules. 5 min
  4. 4 Abstract reference Learn to use objects via abstract references. 5 min
  5. 5 Pattern matching Learn type conversion with instanceof pattern matching. 4 min
  6. 6 Summary - Polymorphism Combine dynamic binding and pattern matching to write a shape renderer. 5 min
12
Project: Blog appProject
5 lessons · 30 min
  1. 1 Model design Design the Post and Comment class skeleton. 6 min
  2. 2 Blog class Set up collection management with the Blog class. 6 min
  3. 3 Adding comments Write the comment flow with addComment. 6 min
  4. 4 Search and filter Write search and filtering with Stream. 6 min
  5. 5 Putting it together Combine the Blog class with a menu loop. 6 min
13
File I/O
6 lessons · 30 min
  1. 1 File class Learn files and directories with File. 5 min
  2. 2 FileReader and FileWriter Learn to read and write text with FileReader and FileWriter. 5 min
  3. 3 BufferedReader Learn to read lines with BufferedReader. 5 min
  4. 4 PrintWriter Learn formatted writing with PrintWriter. 5 min
  5. 5 try-with-resources Learn automatic close with try-with-resources. 5 min
  6. 6 Summary - File I/O Combine BufferedReader and PrintWriter to write a notes app. 5 min
14
Serialization
6 lessons · 30 min
  1. 1 Jackson ObjectMapper Learn to produce JSON from objects with Jackson ObjectMapper. 5 min
  2. 2 readValue Learn to build objects from JSON with readValue. 5 min
  3. 3 writeValueAsString Learn to convert objects to JSON with writeValueAsString. 5 min
  4. 4 JsonProperty Learn field mapping with @JsonProperty. 5 min
  5. 5 List and Map serialization Learn to convert List and Map structures to JSON. 5 min
  6. 6 Summary - Serialization Combine ObjectMapper and @JsonProperty to write a config file. 5 min
15
Generics
6 lessons · 30 min
  1. 1 Generic class Learn to define generic classes with <T>. 5 min
  2. 2 Generic method Learn generic methods with <T>. 5 min
  3. 3 Bounded type Learn bounded types with <T extends Number>. 5 min
  4. 4 Wildcard Learn wildcard types ? extends T and ? super T. 5 min
  5. 5 Type erasure Learn post-compile type erasure. 5 min
  6. 6 Summary - Generics Combine generic class and method to write a Box<T>. 5 min
16
Generic collections
6 lessons · 30 min
  1. 1 List<E> Learn generic lists with List<E>. 5 min
  2. 2 Map<K,V> Learn generic maps with Map<K,V>. 5 min
  3. 3 Set<E> Learn generic sets with Set<E>. 5 min
  4. 4 Queue and Deque Learn queues with Queue<E> and Deque<E>. 5 min
  5. 5 Collections class Learn Collections.sort and frequency helpers. 5 min
  6. 6 Summary - Generic collections Combine List, Map and Set to write a word frequency counter. 5 min
17
Iterator
6 lessons · 30 min
  1. 1 Iterator Learn to iterate collections with Iterator. 5 min
  2. 2 remove Learn safe removal with Iterator.remove. 5 min
  3. 3 ListIterator Learn bidirectional iteration with ListIterator. 5 min
  4. 4 Iterable Learn for-each support with Iterable. 5 min
  5. 5 Spliterator Learn parallel iteration with Spliterator. 5 min
  6. 6 Summary - Iterator Combine Iterator and Iterable to write a custom collection. 5 min
18
Lambda expressions
6 lessons · 30 min
  1. 1 Lambda basics Learn lambda expressions with () -> .... 5 min
  2. 2 Parameterized lambda Learn parameterized lambdas with (x) -> .... 5 min
  3. 3 Method reference Learn method references with Class::method. 5 min
  4. 4 forEach with lambda Learn to use lambdas inside forEach. 5 min
  5. 5 Comparator with lambda Learn sorting with Comparator.comparing. 5 min
  6. 6 Summary - Lambda expressions Combine lambda and method reference to write a sorting helper. 5 min
19
Stream API basics
6 lessons · 30 min
  1. 1 stream() Learn to create streams from collections with stream(). 5 min
  2. 2 filter Learn to filter elements with filter. 5 min
  3. 3 map Learn to transform elements with map. 5 min
  4. 4 forEach and count Learn processing with forEach and counting with count. 5 min
  5. 5 collect toList Learn to collect into a list with collect(Collectors.toList()). 5 min
  6. 6 Summary - Stream API basics Combine filter, map and collect to write an employee filter. 5 min
20
Intermediate finalProject
5 lessons · 30 min
  1. 1 Project design Design the intermediate final skeleton. 6 min
  2. 2 OOP model Set up the class hierarchy and interfaces. 6 min
  3. 3 Stream layer Set up data processing with Stream and lambda. 6 min
  4. 4 File I/O Save and load data as JSON. 6 min
  5. 5 Putting it together Combine all layers into a working app. 6 min

Learn advanced stream, Optional, functional interfaces, java.time, reflection, annotations, design patterns, JUnit, Mockito, multithreading and the concurrent API in Java.

1
Advanced stream
6 lessons · 30 min
  1. 1 collect groupingBy Learn grouping with Collectors.groupingBy. 5 min
  2. 2 partitioningBy Learn two-way partitioning with Collectors.partitioningBy. 5 min
  3. 3 joining Learn string joining with Collectors.joining. 5 min
  4. 4 reduce Learn accumulation with reduce. 5 min
  5. 5 flatMap Learn to flatten nested streams with flatMap. 5 min
  6. 6 Summary - Advanced stream Combine groupingBy, reduce and flatMap to write a sales summarizer. 5 min
2
Optional
6 lessons · 30 min
  1. 1 Optional.of Learn to wrap values with Optional.of. 5 min
  2. 2 ofNullable Learn null safety with Optional.ofNullable. 5 min
  3. 3 map and flatMap Learn map and flatMap on Optional. 5 min
  4. 4 orElse and orElseGet Learn default values with orElse and orElseGet. 5 min
  5. 5 ifPresent and isPresent Learn checks with ifPresent and isPresent. 5 min
  6. 6 Summary - Optional Combine ofNullable, map and orElse to write a user finder. 5 min
3
Functional interface
6 lessons · 30 min
  1. 1 Function<T,R> Learn transformation functions with Function<T,R>. 5 min
  2. 2 Predicate<T> Learn condition functions with Predicate<T>. 5 min
  3. 3 Consumer<T> Learn consumer functions with Consumer<T>. 5 min
  4. 4 Supplier<T> Learn supplier functions with Supplier<T>. 5 min
  5. 5 @FunctionalInterface Learn marking with @FunctionalInterface. 5 min
  6. 6 Summary - Functional interface Combine Function, Predicate and Consumer to write a stream processor. 5 min
4
Date/time API
6 lessons · 30 min
  1. 1 LocalDate Learn dates with LocalDate. 5 min
  2. 2 LocalTime and LocalDateTime Learn time with LocalTime and LocalDateTime. 5 min
  3. 3 Duration and Period Learn spans with Duration and Period. 5 min
  4. 4 DateTimeFormatter Learn formatting with DateTimeFormatter. 5 min
  5. 5 Instant and ZonedDateTime Learn time zones with Instant and ZonedDateTime. 5 min
  6. 6 Summary - Date/time API Combine LocalDate, Period and DateTimeFormatter to write an age calculator. 5 min
5
Reflection
6 lessons · 30 min
  1. 1 Class<?> Learn class metadata with Class<?>. 5 min
  2. 2 getFields Learn field listing with getFields. 5 min
  3. 3 getMethods Learn method listing with getMethods. 5 min
  4. 4 invoke Learn dynamic calls with Method.invoke. 5 min
  5. 5 getDeclaredConstructors Learn constructor listing with getDeclaredConstructors. 5 min
  6. 6 Summary - Reflection Combine getMethods and invoke to write an object inspector. 5 min
6
Annotation
6 lessons · 30 min
  1. 1 Built-in annotations Learn built-in annotations @Override and @Deprecated. 5 min
  2. 2 @interface Learn to define custom annotations with @interface. 5 min
  3. 3 Retention and Target Learn @Retention and @Target meta-annotations. 5 min
  4. 4 Annotation values Learn annotation parameters and default values. 5 min
  5. 5 Annotations via reflection Learn to read annotations with reflection. 5 min
  6. 6 Summary - Annotation Combine @interface and @Retention to write a marking framework. 5 min
7
Design patterns
6 lessons · 30 min
  1. 1 Singleton Learn to write the Singleton pattern in Java. 5 min
  2. 2 Factory Learn the Factory pattern. 5 min
  3. 3 Strategy Learn the Strategy pattern. 5 min
  4. 4 Observer Learn the Observer pattern. 5 min
  5. 5 Decorator Learn the Decorator pattern. 5 min
  6. 6 Summary - Design patterns Combine Singleton, Factory and Strategy to write a payment system. 5 min
8
JUnit test
6 lessons · 30 min
  1. 1 JUnit basics Learn to write tests with @Test. 5 min
  2. 2 Assertions Learn assertions with assertEquals and assertTrue. 5 min
  3. 3 @BeforeEach and @AfterEach Learn setup with @BeforeEach and @AfterEach. 5 min
  4. 4 @ParameterizedTest Learn parameterized tests with @ParameterizedTest. 5 min
  5. 5 @DisplayName Learn test naming with @DisplayName. 5 min
  6. 6 Summary - JUnit test Combine @Test, assertEquals and @ParameterizedTest to write a calculator test. 5 min
9
Mockito
6 lessons · 30 min
  1. 1 Mock Learn mock objects with Mockito.mock. 5 min
  2. 2 @Mock Learn mock injection with @Mock. 5 min
  3. 3 when thenReturn Learn behavior imitation with when(...).thenReturn(). 5 min
  4. 4 verify Learn call verification with verify. 5 min
  5. 5 ArgumentMatchers Learn flexible arguments with ArgumentMatchers. 5 min
  6. 6 Summary - Mockito Combine Mock, when and verify to write a service test. 5 min
10
Multithreading
6 lessons · 30 min
  1. 1 Thread Learn to create threads with Thread. 5 min
  2. 2 Runnable Learn to define tasks with Runnable. 5 min
  3. 3 start and join Learn thread management with start and join. 5 min
  4. 4 synchronized Learn critical sections with synchronized. 5 min
  5. 5 wait and notify Learn thread communication with wait and notify. 5 min
  6. 6 Summary - Multithreading Combine Thread, Runnable and synchronized to write a counter. 5 min
11
Concurrent API
6 lessons · 30 min
  1. 1 ExecutorService Learn thread pools with ExecutorService. 5 min
  2. 2 Callable and Future Learn result-bearing tasks with Callable and Future. 5 min
  3. 3 CompletableFuture Learn async chains with CompletableFuture. 5 min
  4. 4 ConcurrentHashMap Learn parallel maps with ConcurrentHashMap. 5 min
  5. 5 Lock and Condition Learn flexible locks with Lock and Condition. 5 min
  6. 6 Summary - Concurrent API Combine ExecutorService and CompletableFuture to write a parallel downloader. 5 min
12
I/O and NIO basics
6 lessons · 30 min
  1. 1 Path Learn the modern path object with Path. 5 min
  2. 2 Files Learn file operations with Files. 5 min
  3. 3 readString and writeString Learn text I/O with Files.readString and writeString. 5 min
  4. 4 Buffered I/O Learn efficient I/O with BufferedInputStream and BufferedOutputStream. 5 min
  5. 5 Channels Learn channel-based I/O with FileChannel. 5 min
  6. 6 Summary - I/O and NIO basics Combine Path, Files and readString to write a file scanner. 5 min
13
Advanced projectProject
5 lessons · 30 min
  1. 1 Project design Design the advanced project skeleton. 6 min
  2. 2 Stream layer Set up data flow with advanced Stream and Optional. 6 min
  3. 3 Concurrent layer Write parallel operations with ExecutorService. 6 min
  4. 4 Test layer Write tests with JUnit and Mockito. 6 min
  5. 5 Putting it together Combine all layers into a working mini service. 6 min
14
Advanced finalProject
5 lessons · 30 min
  1. 1 Project design Design the advanced final skeleton. 6 min
  2. 2 Stream layer Write data processing with advanced Stream and Optional. 6 min
  3. 3 Concurrent layer Write parallel pipelines with ExecutorService. 6 min
  4. 4 Reflection and annotation Write configuration with reflection and annotations. 6 min
  5. 5 Putting it together Combine all advanced topics into a working app. 6 min

Learn JVM internals, memory model, NIO, reactive, JNI, performance and GC tuning, bytecode and microservice basics in Java.

1
JVM internals
6 lessons · 30 min
  1. 1 JVM architecture Learn the JVM's class loader, runtime and execution engine. 5 min
  2. 2 Class loaders Learn Bootstrap, Platform and Application class loaders. 5 min
  3. 3 Bytecode Learn bytecode and instruction inspection with javap. 5 min
  4. 4 JIT compiler Learn the JIT compiler and its optimizations. 5 min
  5. 5 Runtime data areas Learn stack, heap and metaspace. 5 min
  6. 6 Summary - JVM internals Combine class loaders, bytecode and JIT to write a JVM inspection tool. 5 min
2
Memory model
6 lessons · 30 min
  1. 1 Heap and stack Learn heap and stack memory regions. 5 min
  2. 2 happens-before Learn memory ordering with happens-before. 5 min
  3. 3 volatile Learn visible variables with volatile. 5 min
  4. 4 final field guarantees Learn initialization guarantees of final fields. 5 min
  5. 5 Metaspace Learn the class metadata region with Metaspace. 5 min
  6. 6 Summary - Memory model Combine happens-before and volatile to write a publish utility. 5 min
3
NIO
6 lessons · 30 min
  1. 1 Buffer Learn the NIO buffer with Buffer. 5 min
  2. 2 Channel Learn the NIO channel with Channel. 5 min
  3. 3 Selector Learn multi-channel management with Selector. 5 min
  4. 4 Charset Learn byte-character conversion with Charset. 5 min
  5. 5 Path and Files (NIO.2) Learn the NIO.2 Path and Files API. 5 min
  6. 6 Summary - NIO Combine Buffer, Channel and Selector to write an echo server. 5 min
4
Reactive
6 lessons · 30 min
  1. 1 Flow API Learn reactive streams with the Java 9 Flow API. 5 min
  2. 2 Publisher and Subscriber Learn Publisher and Subscriber roles. 5 min
  3. 3 SubmissionPublisher Learn data publishing with SubmissionPublisher. 5 min
  4. 4 Backpressure Learn flow control with backpressure. 5 min
  5. 5 Project Reactor Mono Learn single-value reactive streams with Project Reactor Mono. 5 min
  6. 6 Summary - Reactive Combine Flow API and SubmissionPublisher to write a temperature monitor. 5 min
5
JNI
6 lessons · 30 min
  1. 1 native methods Learn native method declaration with the native keyword. 5 min
  2. 2 javah and headers Learn to generate headers with javac -h. 5 min
  3. 3 JNIEnv Learn the native call environment with JNIEnv. 5 min
  4. 4 C/C++ implementation Learn JNI implementation with C/C++. 5 min
  5. 5 Foreign Function & Memory API Learn modern native calls with the Java 21 FFM API. 5 min
  6. 6 Summary - JNI Combine native and JNIEnv to write a math native binding. 5 min
6
Performance and GC
6 lessons · 30 min
  1. 1 JMH Learn to benchmark with JMH. 5 min
  2. 2 JFR and jcmd Learn to profile with Java Flight Recorder and jcmd. 5 min
  3. 3 GC tuning Learn G1 and ZGC garbage collector settings. 5 min
  4. 4 Heap dump Learn memory analysis with jmap and heap dumps. 5 min
  5. 5 JIT tuning Learn JIT flags and tiered compilation settings. 5 min
  6. 6 Summary - Performance and GC Combine JMH, JFR and GC tuning to write an optimized handler. 5 min
7
Bytecode (ASM)Project
5 lessons · 30 min
  1. 1 Project design Design the bytecode analysis project skeleton. 6 min
  2. 2 ClassReader Write class reading with the ASM ClassReader. 6 min
  3. 3 ClassVisitor Write method and field scanning with ClassVisitor. 6 min
  4. 4 Bytecode transformation Write bytecode transformation with ASM. 6 min
  5. 5 Putting it together Combine all parts to write a bytecode inspector. 6 min
8
Expert finalProject
5 lessons · 30 min
  1. 1 Project design Design the expert final skeleton. 6 min
  2. 2 Reactive layer Write reactive streams with the Flow API. 6 min
  3. 3 Performance layer Write performance measurement with JMH and GC tuning. 6 min
  4. 4 Microservice basics Write a small HTTP-based microservice skeleton. 6 min
  5. 5 Putting it together Combine all expert topics into a working app. 6 min

Lessons are free, an account keeps your progress

You do not have to sign up. If you do, you continue where you left off and never lose your work.

  • Progress saved on every device
  • Earn XP and badges
  • Keep your daily streak
  • Get a certificate when you finish
create a free account

Frequently asked questions

Are the Java lessons free?

Yes. All 360 lessons of the Java course are free and you can start without an account.

Do I need any prior knowledge?

No. The beginner level starts from zero; a browser is all you need. If you already know the basics, start at a higher level.

How long does the course take?

Lessons take 2–8 minutes. The whole course is about 30 hours; with 15–20 minutes a day you can finish in a few months.

Do I get a certificate?

Yes. When you complete the course with a free account, a verifiable certificate is issued in your name.

Will I lose my progress without an account?

Without an account your progress is kept only in your current browser. When you create a free account it is moved to your account.

Next step PHP

Learn modern PHP 8.3 from variables to OOP, PDO and expert topics with hands-on projects.