关键字就是在程序设计中已经被赋予特定意义的一些单词。通常,关键字也叫保留字。由于编译器在编译过程中进行词法扫描时,对关键字作特殊对待,所以,程序员在程序设计时,要注意不可以把这类单词作为标识符来用,否则会使编译出错。
Java语言中的关键字如下:
abstract boolean break byte case catch char class
continue default do double else extends false find
finally float for if implements import instanceof
int interface long native new null package private
protected public return short static super switch
synchronized this throw throws transient true try
void volatile while
软件开发-昆明伏沃德科技有限公司
2023年3月6日