小编整理的java关键字,内容如下:
abstract, assert, boolean, break, byte, case, catch, char, class, const, continue, default, do, double, else, enum, extends, final, finally, float, for, goto, if, implements, import, instanceof, int, interface, long, native, new, package, private, protected, public, return, strictfp, short, static, super, switch, synchronized, this, throw, throws, transient, try, void, volatile, while
关键字一律用小写字母标识,按其用途划分为如下几组.
(1)用于数据类型
用于数据类型的关键字有 boolean,byte,char, double, float,int,long,new,short,void,instanceof
(2)用于语句
用于语句的关键字有break,case, catch, continue, default ,do, else, for, if,return,switch,try, while, finally, throw,this, super
(3)用于修饰
用于修饰的关键字有 abstract,final,native,private, protected,public,static,synchronized,
transient, volatile
(4)用于方法,类,接口,包和异常
用于方法,类,接口,包和异常的关键字有 class, extends, implements,interface, package,import,throws
还有些关键字,如 future, generic, operator, outer,rest,var等都是Java保留的没有意义的关键字.
另外,Java还有3个保留字:goto,const,null.它们不是关键字,而是文字.包含Java定义的值.和关键字一样,它们也不可以作为标识符使用.