在此处查看此链接.它是Java 6的保留关键字列表.
abstract continue for new switch
assert (c) default goto (a) package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum (d) instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp (b) volatile
const (a) float native super while
(a) not used
(b) added in 1.2
(c) added in 1.4
(d) added in 5.0
Run Code Online (Sandbox Code Playgroud)
所以,不,你列出的那三个单词都不在保留集中.
此关键字列表也可以在3.9节中的Java语言规范中找到.
Java关键字在Java语言规范中列出:
Keyword: one of
abstract continue for new switch
assert default if package synchronized
boolean do goto private this
break double implements protected throw
byte else import public throws
case enum instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp volatile
const float native super while
Run Code Online (Sandbox Code Playgroud)
关键字
const并goto保留,即使它们当前未使用.如果这些C++关键字错误地出现在程序中,这可能允许Java编译器生成更好的错误消息.虽然
true并且false可能看起来像是关键字,但它们在技术上是布尔文字.同样,虽然null看起来可能是关键字,但从技术上讲它是空文字.
| 归档时间: |
|
| 查看次数: |
4692 次 |
| 最近记录: |