勵志

勵志人生知識庫

java保留字有哪些

Java的保留字包括但不限於以下這些:

基本保留字。abstract,assert,boolean,break,byte,case,catch,char,class,const,continue,default,do,double,else,enum,extends,final,finally,float,for,if,implements,import,instanceof,int,interface,long,native,new,package,private,protected,public,return,short,static,strictfp,super,switch,synchronized,this,throw,throws,transient,try,void,volatile,while。

可能未來的保留字。byValue,cast,future,generic,inner,operator,outer,rest,var,goto,const。

特殊的保留字。true,false,null。

其中,"const"和"goto"雖然被保留但目前未被使用。這些保留字是Java語言為了未來版本升級預留的關鍵字,雖然現在沒有作為關鍵字使用,但在以後的版本中有可能作為關鍵字使用。