A year has passed since the last post Java 8-12, three new Java versions have been released, but no big news from a developer’s perspective…

Java 13 (2019)

  • Switch expressions: yield statement (preview)
  • Text blocks (multi-line strings like in Groovy - preview)

Exhaustive feature list. See also Java 13: New Features

Java 14 (2020)

  • Pattern matching of instanceof
    Object obj = /* ...*/
    if (obj instanceof Person p) {
        p.getLastName(); // look ma, no cast!
    }
  • Records - pure data classes without boilerplate code (preview)
    record Person (String firstName, String lastName, Date dateOfBirth) {
    }
  • Text blocks extended (preview)

Exhaustive feature list. See also Java 14: New Features

Java 15 (2020)

  • Sealed classes (preview) - restrict which classes may extend a given class
  • Hidden classes - useful for classes generated at runtime
  • Nashorn JavaScript Engine removed

Exhaustive feature list. See also Java 15: New Features

comments powered by Disqus