Javatpoint Logo
Javatpoint Logo

Java 8 v/s Java 11

Java 11 was publicly available on 25 September 2018 in the market. It is an open-source reference implementation of Java SE platform version 11. Java 11 was released after four years of releasing Java 8.

Java 11 comes with new features to provide more functionality. Below are the features which are added in the four and a half years in between these two versions.

Java 8 v/s Java 11

Modularity

The Modularity feature is not available in Java 8. It is one of the biggest changes that have been added in Java 9. By using modularity, we can split our programs or applications into different modules. Modularity allows us to test our application easily and also managing access to what parts of our code are public-facing. We can compile our code without compiling the file by simply placed it into the module having no name. It behaves in the same way as the Java 8 compile code.

--release flag

It is a very simple combination of -target and -source that allows us -bootclasspath for compiling at the older version. The -release 8 is an example that we need to compile at a Java 8 level.

Multi-jar releases

It is one of the features which is added in Java 11. Multi-jar provides a way to still the code with the latest features of Java 11 while maintaining support and functionality for Java 8 clients.

Var keyword

In Java 10, the var keyword was introduced, which improved in Java 11. The var keyword is a developer-friendly keyword that helps us to reduce the boilerplate coding. The type of infection prevents repeating the same text over and over again by affecting only local variables.

Version String Schema

It is another change between Java 8 and Java 11 which defines how the version strings should be formatted. A new schema introduces for the versions. The schema looks something like as:

Let's understand the difference between both versions of Java on the basis of deprecations. These are the following deprecations which are done in between Java 8 and Java 11.

  1. In Java 11, the support for Java browser plugins is removed and due to which the Applet API has been deprecated.
    Note: it is only depreciated, not yet removed.
  2. CMS, i.e., Concurrent Mark Sweep Garbage Collector, is depreciated and not supported now. The reason for removing it is to reduce the maintenance burden of the GCC base.
  3. With the rapid changes to the ECMAScript API, it has been removed due to the amount of maintenance of the Nashorn JavaScript engine.
  4. In Java 9, the compression scheme is improved, and after this improvement, the Pack200 tools and APIs have been removed.
  5. Java EE module has been removed due to overlap with the Java EE platform specification.
  6. The CORBA module has been removed due to evolving independently of Java SE.

Difference between Java 8 and Java 11

These are the following differences between Java 8 and Java 11:

Sr. No. Java 8 Java 11
1. The appletviewer tool is available in Java 8. The appletviewer tool is not available in Java 11.
2. Java 8 has the AWTUtilities class, which we didn't recommend you to use because it can break any program depending on it. In Java 11, the AWTUtilities class is not available.
3. It has fewer string methods. Several new methods of String such as isBlank(), lines(),repeat(n), stripLeading(), stripTrailing(), and strip() are introduce.
4. No special variables are used for lambda parameters. Java 11 allows us to use var variables to be used in lambda expressions.
5. Java Deployment Technologies are available in Java 8. Java Deployment Technologies are removed in Java 11.
6. JMC and JavaFX are available in the Oracle JDK. JMC and JavaFX are removed from the Oracle JDK in Java 11.
7. There are no suitable methods to work with the file. In Java 11, there are various methods, such as writeString(), readString(), and isSameFile() which help us to perform several operations on file.
8. Pattern recognizing is not possible. Pattern recognizing is possible with the help of the asMatchPredicate() method.

Next TopicLogin Form Java




Youtube For Videos Join Our Youtube Channel: Join Now

Help Others, Please Share

facebook twitter pinterest

Learn Latest Tutorials


Preparation


Trending Technologies


B.Tech / MCA