Stream API Improvements
In Java SE 9, Oracle Corp. has added four useful new methods to java.util.Stream interface. As Stream is an interface, all those new implemented methods are default methods. It allows you to create declarative pipelines of transformations on collections. There are four new methods added to the Stream interface: dropWhile, takeWhile, ofNullable. The iterate method gets a new overload, allowing you to provide a Predicate on when to stop iterating.
Java 9 Features with Examples
Java is a general-purpose, high-level programming language developed by Sun Microsystems. It is concurrent, class-based, object-oriented, and specifically designed to have as few implementation dependencies as possible. Java was meant to follow the “Write Once Run Anywhere” (WORA) principle, i.e., Java is meant to be platform-independent.
Like any other software, Java also comes with many different versions as it develops and gets improved, with new features getting added in every major upgrade. Java 9 was a major upgrade from Java 8 that has brought us a lot of features for developers. Java 9 was released on Sep 21, 2017.