Learn Java
Start from zero and build real Java skills: variables, classes and methods, decisions, arrays and lists, loops, strings, encapsulation, inheritance, debugging and two-dimensional arrays, all in runnable programs.
- Beginner level
- 12 modules
- 70 lessons
- 256 tasks and questions
Syllabus
01Hello, JavaWrite and run your first Java programs. Meet classes and the main method, print text and numbers, write comments, and see how source code becomes bytecode that the JVM runs.6 lessons
02Variables and TypesStore information in named, typed variables. Learn int, double, long, boolean, char and String, Java's naming rules, and how final turns a variable into a constant.6 lessons
03Operators and ExpressionsCalculate with arithmetic operators, update variables in place, control the order of operations, convert between types with casts, and compare values to get booleans.5 lessons
04Classes and ObjectsModel things from the real world as classes. Give objects state with fields, set them up with constructors, give them behavior with methods, and make them print nicely with toString.7 lessons
05Conditionals and LogicLet programs make decisions. Use if, else if and else, choose between many cases with switch, combine conditions with logical operators, and write compact choices with the ternary operator.6 lessons
06Arrays and ArrayListsKeep many values under one name. Create and index arrays, use the Arrays helper class, then switch to ArrayList when a collection needs to grow and shrink.6 lessons
07LoopsRepeat work without repeating code. Write while and for loops, walk through arrays and lists with for-each, steer loops with break and continue, and use the classic counting, summing and filtering patterns.6 lessons
08String MethodsWork with text using the String class. Measure and index strings, find and cut out pieces, compare them correctly, transform them, and format numbers into tidy output.6 lessons
09Access, Encapsulation and StaticProtect an object's data with private fields and well-designed getters and setters, understand scope and this, and learn when state and behavior belong to the class itself with static.6 lessons
10Inheritance and PolymorphismBuild families of related classes. Extend a superclass, call its constructor with super, override methods, control access with protected and final, and treat many kinds of objects through one shared type.6 lessons
11DebuggingFind and fix the three kinds of bugs: compile-time errors the compiler reports, runtime exceptions with their stack traces, and logic errors that quietly produce wrong answers. Handle expected problems with try and catch.5 lessons
12Two-Dimensional ArraysOrganize data in rows and columns. Create 2D arrays, read and change individual cells, traverse them row by row or column by column, and handle rows of different lengths.5 lessons