mirror of
https://github.com/Snailclimb/JavaGuide
synced 2025-06-16 18:10:13 +08:00
Update java新特性总结.md
This commit is contained in:
parent
e4a4e1c300
commit
d84f04332d
@ -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 {
|
||||
|
||||

|
||||
|
||||
在 `java.lang.Class` 增加了两个公共方法用于获取 `Record` 类信息:
|
||||
|
||||
1. `RecordComponent[] getRecordComponents()`
|
||||
2. `boolean isRecord()`
|
||||
|
||||
#### instanceof 模式匹配
|
||||
|
||||
Java 15 并没有对此特性进行调整,继续预览特性,主要用于接受更多的使用反馈。
|
||||
|
Loading…
x
Reference in New Issue
Block a user