FOSS Software

Java 17 LTS Released

Pinterest LinkedIn Tumblr

Java 17 with Extended Support (LTS) has been released. The previous version with extended support, Java 11, was released in 2018.

The most notable change in this release is that support for sealed classes and interfaces has moved out of the preview stage and is now ready for use.

Sealed types are classes or interfaces that impose constraints on other classes or interfaces that can extend or implement them. To declare a sealed class or interface, use the modifier sealed… The list of subtypes can be listed by declaring a sealed class or interface after the keyword permits… If the subtypes are in the same package or module, the compiler itself can display the list of subtypes and permitscan be omitted in a sealed class or interface declaration.

sealed interface Color permits BiColor, TriColor { }
	
record BiColor(int r, int g, int b) implements Color {}
record TriColor(int r, int g, int b) implements Color {}

Specifications implemented:

>>> Details

Kali Linux 2021.3 Available to Download

Write A Comment

Exit mobile version