关于关键字,我在很多书上看到不同的说明,在最新的SCJP考试指南上并没有说它们是关键字,请问到底是不是呢?请顺便给个资料证明一下SCJP中java的50个关键字是:abstract assertboolean break bytecase catch char class const continuedefault do doubleelse extends enumfinal finally float forgotoif implements import instanceof int interface longnative newpackage private protected publicreturnshort static strictfp super switch synchronizedthis throw throws transient tryvoid volatilewhile

解决方案 »

  1.   

    我们说一个很直白的理解吧,
    关键字:用过了EditPlus、eclipse之类的java编译器的都知道它们带有关键字变色的效果吧?
    你注意看过了没有,false、true、null 都变色了。
    这就说明它是关键字。
    再看看 const和goto吧,它们也是关键字,即便它们没被使用,但是你写出来就是变色的。具体的我不好解释,我自己也记的不是很清晰,不能误人子弟
      

  2.   

    Java 中共有 53 个标识符或称为保留字,其中 50 个为关键字(goto, const 目前尚未使用);另外 3 个是值,这 3 个值为 true, false 和 null参考 Java Language Specification, 3rd ed., 3.9 Keywords
    http://java.sun.com/docs/books/jls/third_edition/html/lexical.html#3.9
      

  3.   

    它们是java的保留字,具有特殊含义,而非关键字
      

  4.   

    同意warlockyj讲的。true,false,null是字面量。goto,const是java保留地关键字