Java 9: Key features

Java 9 was released on 2017 but in 2019 was still a really hot topic. As I’m coming back to the java world in 2022 I need to keep useful links, examples and general resources to reduce my technical debt.

Java 8 released 3 big projects:

  • Date API
  • Lambda Expressions
  • Stream API

Java 9, in the same way, released 3 big projects:

There was an additional and really important feature in Java 9 that includes Reactive Streams in the Java standard world but that would be a different article (example here).

This project includes the following small changes:

  • Allow @SafeVargs on private instance methods - example
  • try-with-resources: Now effectively-final variables can be used as resources in this statement.
  • Diamond operator now works with anonymous classes
  • Interfaces supports private methods
  • Underscore _ is no longer a legal identifier name
  • Official Project Docs