~/talk

The Art of Java Type Patterns

Talkat Jfokus 2022 · 2022-05-02..05-04· [java, compilers-and-language-design]
slides:none on file

Covers concrete language changes: pattern matching for instanceof (preview in JDK 14, final in JDK 16) removes redundant casts and uses flow scoping; pattern matching for switch (JEP 406 in JDK 17) adds null labels, guarded cases, dominance and completeness checks and shifts to a when guard in upcoming JDK 19 (JEP 427); records (JDK 14) enable record deconstruction patterns and composition with var and proposed array patterns; sealed classes (JDK 15) make exhaustive switches practical. Code examples show compiling rules and where the compiler rejects unreachable cases.

AI-written summary · about

  1. 0:00Intro
  2. 0:30Modern Java
  3. 3:17Pattern Matching Fundamentals
  4. 4:20Pattern Types
  5. 6:12Switch Expressions
  6. 7:34Switch Statement
  7. 8:18Switch Expression (JDK 12)
  8. 10:10Simple Java Data Class
  9. 11:53Records (JDK 14)
  10. 12:19Records Additional Details
  11. 13:47Java Inheritance
  12. 14:23Sealed Classes (JEP 360)
  13. 16:16Using The instanceof Operator
  14. 17:24Pattern Matching For instanceof (JDK 14)
  15. 20:30Flow Scoping For Binding Variables Scope of local variable runs from its declaration until the end of the block in which it is dedared
  16. 23:06Pattern Matching For instanceof Puzzler
  17. 24:23JDK 18 jshell
  18. 29:57Pattern Matching for switch (Completeness)
  19. 31:19Guarded Patterns (JDK 18)
  20. 33:10Guarded Patterns (JDK 19)
  21. 33:29Pattern Dominance
  22. 36:38Pattern Matching instanceof And Records
  23. 37:24Pattern Matching For Records (JEP 405)
  24. 38:17Patterns Are Composable
  25. 40:08Patterns And Local Variable Type Inference
  26. 41:57Pattern Matching For Arrays
  27. 44:01Azul Zulu Builds of OpenJDK • Enhanced build of Open source code
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.