What are the new features of java 9
Java is a general-purpose, high-level language developed by Sun Microsystems. It is concurrent, object-oriented, class-basedand specially designed to have a few modification dependencies as possible. Java was once intended to comply with the “Write Once Run Anywhere” (WORA) principle, i.e., Java is supposed to be platform-independent.
Java 9 was once the main improvement from Java 8 that has delivered us a lot of aspects for developers. Java 9 was once launched on July 27, 2019. In this article, we will seem to be into Java 9 aspects in detail:
If you are searching for Java Interview Questions then you can go here. This will clearly assist you to crack your interviews.
1. Improved Javadoc
Java 9 replace got here with an up to date Java documentation. We no longer want to use Google to discover the proper documentation. The new Javadoc got here with a search proper in the API documentation itself. Moreover, the Javadoc output was once HTML5 compliant. Every Javadoc web page consists of data on which JDK module the classification or interface comes from.
2. Factory techniques for collections
Many times, you prefer to create a series (e.g., a List or Set) in your Java software and fill it with some elements. That leads to repetitive coding the place you instantiate the collection, accompanied via various ‘add’ calls. With Java 9, quite a few so-called series manufacturing unit techniques have been added.
3. JShell: the interactive Java REPL
Oracle Corp. has added a new device referred to as “platform-independent”. It stands for Java Shell and additionally acknowledged as REPL (Read Evaluate Print Loop). It is used to execute and check any Java Constructs like class, interface, enum, object, statements, etc. very easily. You can launch jshell from the console and without delay begin typing and executing Java code.
4. Stream API Improvements:
In Java SE 9, Oracle Corp. has delivered 4 beneficial new strategies to java.util.Stream interface. As Stream is an interface, all these newly carried out strategies are default methods. It approves you to create declarative pipelines of transformations on collections. There are 4 new techniques delivered to the Stream interface: dropWhile, takeWhile, ofNullable. The iterate technique receives a new overload, permitting you to furnish a Predicate on when to end iterating.
5. Private techniques in Interfaces:
In Java 8, we can furnish technique implementation in Interfaces the use of Default and Static methods. However, we can't create non-public techniques in Interfaces. To keep away from redundant code and greater re-usability, Oracle Corp. added non-public strategies in Java SE 9 Interfaces.
6. Multi-Resolution Image API:
In Java SE 9, Oracle Corp. delivered a new Multi-Resolution Image API. The necessary interface in this API is MultiResolutionImage . It is on hand in java.awt.image package. MultiResolutionImage encapsulates a set of photos with distinct Height and Widths and lets in us to question them with our requirements.
7. The Java(9) Platform module system:
One of the huge modifications or java 9 function is the Module System. Oracle Corp. delivered the following facets as section of the Jigsaw Project:
• Modular JDK
• Modular Java Source Code
• Modular Run-time Images
• Encapsulate Java Internal APIs
• Java Platform Module System
8. Improvements in Process API:
Java SE 9 is coming with some enhancements in Process API. They have brought a couple of new instructions and strategies to ease the controlling and managing of OS processes.
Two new interfaces in Process API:
• java.lang.ProcessHandle
• java.lang.ProcessHandle.Info
Note: We have collections of Best Interview Questions and Answers that help people to crack their interviews easily.















