Pages

Friday, November 19, 2021

Java 8 Vs Java 11 - Developers Must know

1. Overview

In this tutorial, We'll learn what are the key differences between java 8 and java 11.

Java 8 is introduced on March 14th 2014 which is released with major changes after a very long time to compete with other programming languages such as scala.

Java 11 is introduced on September 25th 2018 which is after 4 years of java 8.

In the next sections, we will see the main core concepts in java 8 and java 11. And also what are the other core features added in java 9 also.
Java 8 Vs Java 11



2. Java 8 Features


The following are the core features that are added in java 8.

2.1 Lambda Support
2.2 Stream api
2.3 Functional interfaces
2.4 New DateTime api
2.5 Optional API
2.6 JavaFx changes

3. Java 11 New Features


The following are the core features that are added after java 8 and till java 11.

3.1 Modularity
3.2 JShell
3.3 Local varaible type inference
3.4 ZGC garbage collector
3.5 Interface provate methods
3.6 HTTP 2 client
3.7 Process API updates

4. Java 8 vs Java 11 Deprecations & Removals


Let us take a look the deprecations are done in between java 8 and java 11.

4.1 In java 11, java browser plugins support is stopped because of applet api also deprecated.
but thses are not removed and only deprecated.

4.2 The support for the Concurrent mark sweep(CMS) garbage colelctor is removed now to avoid the maintainacne on GCC base.

4.3 Compression formula is improved in java 9. After these improvement, pack200 tools and its api has been removed.

4.4 CORBA module is removed due to independent evolvemnt of java SE.

4.5 Nashron javascript engine is added in java 8 but frequent changes to the ECMAScript, it is difficult to maintain all the changes in Nashron engine.
Nashron javascript engine is removed from java 11 onwards.

4.6 From java 11 onwards, JavaFx, Java Applets, Java web start, Java EE are removed from the JDK now.


5. Differences between Java 8 vs Java 11 Features

Java 8 vs Java 11


5.1 There is no var keyword to delcare the variables in java 8 but var is added in the java 11.  And also var can be used in the lambda alos.

(var a, var b) -> a * b:

5.2 Java 11 provides the support for the HTTP 2 api.

5.3 String api is enriched with the new methods in java 11.

5.4 Java 8 has AWTUtilities class where as it is removed in java 11.

5.5 In java 8, Applet tool viewer is avaialble in java 8 but it is removed in java 11

5.6 Java 11 Files api is added with the useful methods such as readString() and writeString(), other methods.

5.7 Java 11 is added with the asMatchPredicate() method in Pattern class but the same is not present in java 8.


6. Conclusion

In this article, we've seen differences between java 8 and java 11. What are removed and deprecated?.

No comments:

Post a Comment

Please do not add any spam links in the comments section.