Prev Next

Java / Java 11

List some of the Java 11 Features.

Java 11 is the first long-term support (LTS) release after Java 8. Oracle also stopped supporting Java 8 in January 2019. So it becomes mandatory for the application teams to onboard to Java 11 ASAP.

some of the new features include,

new methods/API to the String class: isBlank, lines, strip, stripLeading, stripTrailing, and repeat.

easier way to read and write Strings from files using readString and writeString static methods from the Files class.

Path filePath = Files.writeString(Files.createTempFile("tempDIR", "demo", ".txt"), "Javapedia.net");
String fileContent = Files.readString(filePath);
System.out.println(fileContent); // prints Javapedia.net

The java.util.Collection interface adds a new default toArray method which makes it easy to create an array from a collection using its right data type.

List myListCollection = Arrays.asList("orange", "Apple");
String[] convertedArray = myListCollection.toArray(String[]::new);
System.out.println(convertedArray);

addition of Predicate.not method like Predicate.not(String::isBlank)),

addition of support for using the local variable syntax (var keyword) in lambda parameters,

The new HTTP client from the java.net.http package was introduced in Java 9. It has now become a standard feature in Java 11.

We don't have to compile the Java source files with javac explicitly anymore, we can directly run the file using the java command:

>java HelloWorld.java
Hello world!

Nest-Based Access Control.

Java 11 introduced the Z Garbage Collector (ZGC).

Invest now in Acorns!!! 🚀 Join Acorns and get your $5 bonus!

Invest now in Acorns!!! 🚀
Join Acorns and get your $5 bonus!

Earn passively and while sleeping

Acorns is a micro-investing app that automatically invests your "spare change" from daily purchases into diversified, expert-built portfolios of ETFs. It is designed for beginners, allowing you to start investing with as little as $5. The service automates saving and investing. Disclosure: I may receive a referral bonus.

Invest now!!! Get Free equity stock (US, UK only)!

Use Robinhood app to invest in stocks. It is safe and secure. Use the Referral link to claim your free stock when you sign up!.

The Robinhood app makes it easy to trade stocks, crypto and more.


Webull! Receive free stock by signing up using the link: Webull signup.

More Related questions...

Show more question and Answers...

Java 12

Comments & Discussions