Course

Modern Java, from 17 to 21

What Java has gained since version 8: records, sealed classes, pattern matching, text blocks, Optional, and virtual threads.

Intermediate 7 lessons
Modern Java, from 17 to 21

Lessons

  1. 1 Introduction Vous saurez choisir une version de Java pour un projet, comprendre le cycle de publication semestriel, et utiliser var sans dégrader la lisibilité de votre code.
  2. 2 Records You'll learn how to replace a data-carrying class with a record, put your validation inside it, and recognize the situations where a record is the wrong choice.
  3. 3 Sealed classes You'll learn to restrict a hierarchy's permitted subtypes with sealed and permits, and to model a sum type that the compiler can verify.
  4. 4 Pattern Matching You'll learn to replace instanceof chains with switch on types, destructure a record inside a pattern, and rely on compiler-verified exhaustiveness.
  5. 5 Text and strings You'll learn to write readable SQL or JSON in a text block, master the indentation and escaping rules, and use the methods added to String since Java 8.
  6. 6 Optional and streams You'll learn to use Optional where it was designed to serve, take advantage of the additions made to streams since Java 8, and recognize the cases where a loop is still the best choice.
  7. 7 Virtual threads You'll learn why the thread-per-request model is viable again, how to structure concurrent calls, and when virtual threads bring no gain at all.
Link copied!