Text Blocks (Preview)
Switch Expressions Enhancements (Preview)
FileSystems.newFileSystem() Method
DOM and SAX Factories with Namespace Support
Reimplement the Legacy Socket API
Dynamic CDS Archive
ZGC: Uncommit Unused Memory
Text Blocks:
This is a preview feature. It allows us to create multiline strings easily. The multiline string has to be written inside a pair of triple-double quotes.
The string object created using text blocks has no additional properties. It’s an easier way to create multiline strings. We can’t use text blocks to create a single-line string.
The opening triple-double quotes must be followed by a line terminator.
Switch Expressions Enhancements (Preview):
Switch expressions were added as a preview feature in Java 12 release. It’s almost same in Java 13 except that the “break” has been replaced with “yield” to return a value from the case statement.
FileSystems.newFileSystem() Method:
New methods have been added to read content as a file system.
Reimplement the Legacy Socket API: Socket is reimplemented in java 13 using nio package.
The underlying implementation of the java.net.Socket and java.net.ServerSocket APIs have been rewritten. The new implementation, NioSocketImpl, is a drop-in replacement for PlainSocketImpl.
It uses java.util.concurrent locks rather than synchronized methods. If you want to use the legacy implementation, use the java option -Djdk.net.usePlainSocketImpl.
Dynamic CDS Archive:
class-data sharing feature, which was introduced in Java 10. Now, the creation of CDS archive and using it is much easier.
ZGC: Uncommit Unused Memory:
enhanced ZGC to return unused heap memory to the operating system. The Z Garbage Collector was introduced in Java 11. It adds a short pause time before the heap memory cleanup. But, the unused memory was not being returned to the operating system. This was a concern for devices with small memory footprint such as IoT and microchips. Now, it has been enhanced to return the unused memory to the operating system.
#JavaBeam #Java13NewFeatures #JavaTextBlocks #JavaSwitchExpressions #Java
Watch video Java 13 Features | All Java JDK 13 new features at glance | Java Beam online without registration, duration hours minute second in high quality. This video was added by user Java Beam 28 September 2020, don't forget to share it with your friends and acquaintances, it has been viewed on our site 822 once and liked it 6 people.