All tutorials
Java tutorial
Typed, structured and everywhere in industry. Classes from the first line.
- 01Your first Java programWhat Java is, why every program starts in a class, compiling and running with javac and java, printing, and reading error messages.8 min
- 02Variables and data typesJava's primitive types and their ranges, String, overflow and long, var, final, and converting between types with casts and parsing.10 min
- 03Operators and reading inputArithmetic, remainder and increment, comparisons, logical operators, the == trap with objects, and reading input with Scanner and BufferedReader.10 min
- 04Strings and StringBuilderString methods for length, characters, substrings, searching and splitting, why strings never change, building text efficiently with StringBuilder, and comparing correctly.10 min
- 05Decisions with if and switchChoosing what runs with if, else if and else, the ternary operator, the classic switch with break, and the modern switch expression that returns a value.9 min
- 06LoopsThe counting for loop, the enhanced for over arrays and lists, while and do while, break and continue including labelled break, and off-by-one errors.9 min
- 07MethodsWriting static methods with parameters and return types, overloading, how Java passes arguments, why changing an array inside a method is visible outside, and recursion.10 min
- 08Arrays and ArrayListFixed-size arrays and their defaults, the Arrays helpers, two-dimensional arrays, the growable ArrayList with its boxing pitfalls, and sorting both.12 min