public abstract sealed class Shape permits Circle, Rectangle, Square {}
public abstract sealed class Root {
public static final class A extends Root {}
public static sealed class B extends Root permits BB {}
public static non-sealed class C extends Root {}
}
密封接口
public sealed interface Shape permits Circle, Rectangle, Square {}
public sealed interface Root {
public final class A implements Root {}
public sealed class B implements Root permits BB {}
public sealed interface C extends Root permits CC {}
public non-sealed class D implements Root {}
public non-sealed interface E extends Root {}
}
始终使用严格浮点模式
无需再使用
strictfp
关键字,Java将始终使用严格浮点模式伪随机数生成器
限制使用JDK内部类
删除了
--illegal-access
选项Sealed类型
permits
指定的类/接口必须位于同一模块或同一包中密封类
密封接口
反序列化过滤器