How it works
Each lesson is a short read with Java examples and what each one prints. Then practice questions: say what a snippet prints (Java’s output exactly, capitals and all), pick an answer, tap lines of code or steps into order, or tap the line of an error message that gives the cause away. You can try again as often as you like; after two misses there’s a button to show the answer. To run an example yourself, save it as Main.java (adding the public class Main and main lines around it if it doesn’t have them, and import java.util.*; at the top for lists, maps and the other collections) and run java Main.java.
What do I need to know first?
Nothing. It starts from zero. You don't need Java installed to follow along, but it helps to try the examples yourself: install a free JDK (version 21 or later, for example Eclipse Temurin) or paste them into any online Java editor. Every example that shows what it prints was compiled and run on Java 21.
Related courses
- Computer science: Programming basics: 9 lessons
- Computer science: Data structures: 8 lessons
- Computer science: Algorithms: 8 lessons
- Linux: Processes and scripts: 8 lessons
- SQL: SQL from zero: 10 lessons
- Intermediate Java: 9 lessons
- Advanced Java: 9 lessons
Where is my progress saved? In this browser, like the rest of the site. Nothing to sign up for.
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates. This course isn’t made by or affiliated with Oracle. Library and tool names (Maven, Gradle, JUnit, Mockito, SLF4J, Logback, Log4j, Spring Boot) are used only to say what they are. Every shop, service, file and person in the examples is made up.