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).

It's right time to invest in Cryptocurrencies! Earn free bitcoins up to $250 now by signing up.

Earn bitcoins upto $250 (free), invest in other Cryptocurrencies when you signup with blockfi. Use the referral link: Signup now and earn!

Using BlockFi, don't just buy crypto - start earning on it. Open an interest account with up to 8.6% APY, trade currencies, or borrow money without selling your assets.


Join CoinBase! We'll both receive $10 in free Bitcoin when they buy or sell their first $100 on Coinbase! Available in India also. Use the referral Join coinbase!


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...

Spring

Comments & Discussions