Java 9: Key features
Contents
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).
Milling Project Coin
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
Project Jigsaw
- Official Project Docs Key documents, presentations & other resources
- Modular JDK
- Modular Java Source Code
- Modular Run-time Images
- Encapsulate Java Internal APIs
- Java Platform Module System
- The Java Linker
- Java 9 Modules
- Java 9 Modules Example
- 2016 - Project Jigsaw: Under The Hood
- 2017 - Modular Development with JDK 9 by Alex Buckley
- 2018 - Hands-on with Modules
- 2019 - Java 9 and Beyond by Venkat Subramaniam
Java Shell (jshell)
Additional Features
- Process API Updates
- CompactStrings
- Collections factories
- Unicode 8.0
- Add More Diagnostic Commands
- Multi-Release JAR Files
- Enhanced Java Control Panel
- Make G1 the Default Garbage Collector
- Java Ahead of Time Compilation
- HttpClient
- Streams add methods (iterate, takeWhile)
- Optionals: ifPresentOrElse