JAVA

Java — Beginner

BeginnerJava 21+ · 8 lessons

Start from zero with Java: install the JDK, run your first program, and learn the fundamentals — types, decisions, loops, methods, arrays, strings and your first classes. All examples run with Java 21 using a single `java File.java` command.

Lessons

  1. 1Setting up JavaInstall the JDK, understand the main method, and run your first program.Solution4-question quiz
  2. 2Variables, Types & StringsPrimitive types, String, var, casting, integer division and formatting output.Solution4-question quiz
  3. 3Decisions, Switch & Loopsif / else, switch expressions, the ternary operator, for, enhanced for, while and do-while.Solution4-question quiz
  4. 4MethodsDefine static methods with parameters and return types, overload them, and pass values.Solution4-question quiz
  5. 5Arrays & StringsCreate and process arrays, use the Arrays helper class, and build text with StringBuilder.Solution4-question quiz
  6. 6Classes & ObjectsFields, constructors, methods, encapsulation with private fields, and toString.Solution4-question quiz
  7. 7Reading Input with ScannerRead what the user types with Scanner, validate it, keep asking until it's right, and format output with printf.Solution4-question quiz
  8. 8Dates & Times with java.timeLocalDate, Period, ChronoUnit, formatting and parsing, time zones with ZonedDateTime, and Duration.Solution4-question quiz
Start with lesson 1 →
Ask AI