Java 中關鍵字和保留字有什麼區別?


關鍵字

Java 中的關鍵字對編譯器具有特殊含義,因此不能用作識別符號。Java 提供了一組 50 個關鍵字。

abstractcontinuefornewswitch
assertdefaultgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntransient
catchextendsintshorttry
charfinallongstrictfpvolatile
constfloatnativesuperwhile

保留字

在上面列出的關鍵字列表中,關鍵字 goto 和 const 目前未使用。它們是保留字(供將來使用)。

更新於: 2020年2月18日

631 次檢視

開啟你的 職業生涯

透過完成課程獲得認證

開始學習
廣告

© . All rights reserved.