Java9 is ready to roll on the minds of developer after Java8 brings revolution by introducing lambda. Most of the developers start compiling code with higher version of Java while using same old coding standards.
The fact is we do not have implementation knowledge of new Java version features. I got an opportunity to attend a seminar on Java9 and I am sharing my learning and earning as a developer.
Few of its features are :-
Java + REPL = JShell.
Enhancement in Process API.
Try with Resources update.
Diamond Operator update.
Deprecation of Underscore.
Private Methods in Interface.
I. JShell :-
You need not to compose class and main method to test small piece of code.
Get into JShell mode by writing jshell and you are all ready to go.
II. Try with Resource updation :-
Try with Resources was first introduced in Java7 and since then there were lot of improvements. Below is difference between establishing JDBC connection with Java8 and Java9:-
III. Error while using Underscore
Java Community make it clear in Java8 by deprecating underscore and now in Java9 underscore will throw an error.
UPDATE:- Alone underscore will throw an error and not names containing underscore.
IV. Interface can have Private Methods –
Interface assumes a noteworthy part in programming and also it is used to design API and to implement Remote Method Invocation. Interface has seen many changes in JAVA7 , JAVA8 and now JAVA9. Below is the difference:-