From d84f04332d3e9ec0bbe2b92dcbf15a3fbaffb7af Mon Sep 17 00:00:00 2001 From: guide Date: Thu, 16 Sep 2021 19:21:10 +0800 Subject: [PATCH] =?UTF-8?q?Update=20java=E6=96=B0=E7=89=B9=E6=80=A7?= =?UTF-8?q?=E6=80=BB=E7=BB=93.md?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/java/new-features/java新特性总结.md | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/docs/java/new-features/java新特性总结.md b/docs/java/new-features/java新特性总结.md index 11e75d96..d27c7489 100644 --- a/docs/java/new-features/java新特性总结.md +++ b/docs/java/new-features/java新特性总结.md @@ -864,7 +864,7 @@ System.out.println(encodedString); ### 预览新特性 -#### record 关键字 +#### 密封类 Java 15 对 Java 14 中引入的预览新特性进行了增强,主要是引入了一个新的概念 **密封类(Sealed Classes)。** @@ -892,11 +892,6 @@ public non-sealed class Manager extends Person { ![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/javaguide/image-20210820153955587.png) -在 `java.lang.Class` 增加了两个公共方法用于获取 `Record` 类信息: - -1. `RecordComponent[] getRecordComponents()` -2. `boolean isRecord()` - #### instanceof 模式匹配 Java 15 并没有对此特性进行调整,继续预览特性,主要用于接受更多的使用反馈。