Skip to content

Commit d84f043

Browse files
committed
Update java新特性总结.md
1 parent e4a4e1c commit d84f043

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

docs/java/new-features/java新特性总结.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -864,7 +864,7 @@ System.out.println(encodedString);
864864

865865
### 预览新特性
866866

867-
#### record 关键字
867+
#### 密封类
868868

869869
Java 15 对 Java 14 中引入的预览新特性进行了增强,主要是引入了一个新的概念 **密封类(Sealed Classes)。**
870870

@@ -892,11 +892,6 @@ public non-sealed class Manager extends Person {
892892

893893
![](https://guide-blog-images.oss-cn-shenzhen.aliyuncs.com/javaguide/image-20210820153955587.png)
894894

895-
`java.lang.Class` 增加了两个公共方法用于获取 `Record` 类信息:
896-
897-
1. `RecordComponent[] getRecordComponents()`
898-
2. `boolean isRecord()`
899-
900895
#### instanceof 模式匹配
901896

902897
Java 15 并没有对此特性进行调整,继续预览特性,主要用于接受更多的使用反馈。

0 commit comments

Comments
 (0)