l 在Java语言中,有一部分单词被赋予了特殊的含义,这些单词被称之为关键字。
l Java中一共有51个关键字和2个保留字
l 关键字中的所有字母都是小写
l 不能使用保留关键字来命名类、接口、方法、变量。
l Java中的关键字
Ø 数据类型
boolean byte char short int long float double void class interface
Ø 流程控制
If else do while for switch case default break continue return try catch finally
Ø 修饰符
public protected default private final static strictfp abstract transient synchronized volatile native assert
Ø 操作
package import throw throws extends implements this super new
instanceof
Ø 其他
true false null goto const
l Java中的保留字
goto、const,两个保留字不可以使用。
本文由职坐标整理并发布,希望对同学们有所帮助。了解更多详情请关注职坐标编程语言JAVA频道!