Jv Course · 57 lessons · approx. 383 minutes

Learn Java

Java is a programming language for servers, desktop programs and many other applications. The compiler translates your code into bytecode, which the Java runtime executes. We use the classic Main class so that the examples also work with widely used Java versions. Every new building block is first explained on short pages. The coding exercises compare solution patterns without pretending to be a compiler; you can run free programs in the compiler with a suitable runtime.

  • Hallo, Java!
  • int: remember a number
  • String: storing text
  • Calculating and assigning
  • boolean and comparisons
  • if and else
  • for: three passes
  • Arrays and index 0
  • Methods: naming a calculation
  • Your Java points coach
  • StringBuilder: building text step by step
  • HashMap: finding values by name
  • Integer.parseInt: text becomes a number
  • ArrayList: a list that may grow
  • Your own class: data and methods
  • interface: a shared ability
  • try and catch: catching errors
  • while: repeat as long as it is true
  • Streams: filtering and adding up
  • Scanner: reading lines deliberately
  • StringBuilder for texts built step by step
  • Sorting arrays with the standard library
  • Reading map values with a default
  • Expressing a fixed choice with enum
  • List.of as an immutable list
  • Handling an optional result explicitly
  • Placing Java assertions correctly
  • Mastering collections
  • Object orientation
  • Modern Java
  • Handling exceptions
  • Interfaces and generics
  • Lambdas and Optional

What you’ll learn

  1. Chapter 1From the first character to your own value – Starting point, output, variables and calculating.
    Hallo, Java! · int: remember a number · String: storing text · Calculating and assigning
  2. Chapter 2Deciding and repeating – Check values and control small sequences.
    boolean and comparisons · if and else · for: three passes
  3. Chapter 3Your own building blocks and a mini project – Organise data, build functions and connect what you have learned.
    Arrays and index 0 · Methods: naming a calculation · Your Java points coach
  4. Chapter 4Level up: your next practice chapter – Understand four new building blocks in small steps and use them yourself.
    StringBuilder: building text step by step · HashMap: finding values by name · Integer.parseInt: text becomes a number · ArrayList: a list that may grow
  5. Chapter 5Master chapter: how real programs are built – Five building blocks from real projects – explained, connected, filled in and written by you.
    Your own class: data and methods · interface: a shared ability · try and catch: catching errors · while: repeat as long as it is true · Streams: filtering and adding up
  6. Chapter 6Project tools: understand and apply – Eight more building blocks with explanation pages and four exercises per lesson.
    Scanner: reading lines deliberately · StringBuilder for texts built step by step · Sorting arrays with the standard library · Reading map values with a default · Expressing a fixed choice with enum · List.of as an immutable list · Handling an optional result explicitly · Placing Java assertions correctly
  7. Chapter 7Mastering collections – Sets, maps, sorting and cleaning up – the tools from java.util.
    HashSet: every value only once · Looping through a map: entrySet · Sorting lists: Collections.sort · Cleaning up with removeIf · Boss: a word counter with merge
  8. Chapter 8Object orientation – Constructors, encapsulation, inheritance, abstract classes and polymorphism.
    Constructors and this · private fields and getters · Inheritance with extends and super · abstract and @Override · Boss: toString and polymorphism
  9. Chapter 9Modern Java – record, switch expressions, var, String.format and streams with Collectors.
    record: data in one line · switch as an expression with -> · var: the compiler recognises the type · String.format: texts with placeholders · Boss: streams with map and Collectors
  10. Chapter 10Handling exceptions – Catch errors, clean up with finally, throw exceptions yourself and write your own exception classes.
    Catching errors: try and catch · Cleaning up with finally · Raising the alarm yourself: throw · Your own exceptions: extends Exception · Boss: processing input safely
  11. Chapter 11Interfaces and generics – Contracts with interface, classes and methods for any type, Comparable and a generic storage.
    Contracts with interface · One box for everything: generics · Generic methods · Making things comparable: Comparable · Boss: a generic storage
  12. Chapter 12Lambdas and Optional – Conditions and functions as values, Optional instead of null, method references and a leaderboard with Comparator.
    Conditions as values: Predicate · Chaining functions: Function · Optional instead of null · Method references: Class::method · Boss: a leaderboard with Comparator

Final project: Java points coach

Combine variables, a decision and an output into your own points coach.

How it works

Every lesson starts with short explanation pages. Then you practise with multiple-choice questions, fill-in-the-gap tasks, putting code in order and writing your own code – with hints and instant feedback. Free, without ads, on phone, tablet and PC.

Learn Java now