true,false,null是常量这种说法,请给个根据

解决方案 »

  1.   

    如果说常量不能做命名的话
    String s="classjava";
    classjava就是一个字符常量,但是她可以做为命名
      

  2.   

    由以上说推出,true,false,null就是java的关键字,她在java中赋予特定的意义,so不能用来命名
      

  3.   

    我觉得楼上说的有道理true,false,null就是java的关键字,但有些书里为什么说它们不是,不明白。
      

  4.   

    它们的英文名字叫primitive value(基本量)
    你说的也不对啊
    -------
    如果说常量不能做命名的话
    String s="classjava";
    classjava就是一个字符常量,但是她可以做为命名
    ----------
    classjava不是常量,"classjava"就是常量----------
    由以上说推出,true,false,null就是java的关键字,
    --------------
    我以人格担保,你说的是错的
      

  5.   

    我以人格担保,你说的是错的
    __________________________________
    呵呵,的确你说这话就是错了,凡事都要就事论事,就楼主提出来的问题
    true,false,null就是java的关键字
    但是一个符号当然可以担当两个角色,但是不可以混为一谈
    true,false,null在关键在boolean的定义下,是用作常量来定义逻辑变量的赋值,可以看成常量
    _________________________________
    对于你认为该东东是常量来判断不是关键字,这点我认为错了(呵呵,人都有错,我不想用人格来担保^_^)
      

  6.   

    classjava不是常量,"classjava"就是常量
    ________________________________________________
    这一点你也说错了,classjava是常量,计算和操作的时候就用这个classjava
    而"classjava"是做为常量表示,是一种表示形态,用来区别变量classjava哈哈
    这又支持了常量也可以做为变量命名,强调命名
      

  7.   

    3.9 Keywords
    The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers (§3.8):Keyword: one of
    abstract    default    if            private      this
    boolean     do         implements    protected    throw
    break       double     import        public       throws
    byte        else       instanceof    return       transient
    case        extends    int           short        try
    catch       final      interface     static       void
    char        finally    long          strictfp     volatile
    class       float      native        super        while
    const       for        new           switch
    continue    goto       package       synchronizedThe keywords const and goto are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs. While true and false might appear to be keywords, they are technically Boolean literals (§3.10.3). Similarly, while null might appear to be a keyword, it is technically the null literal (§3.10.7). \\\\\\\\\\\\\\这是我刚刚上sun的网站查的《The Java Language Specification》
    我想这能说明问题了吧
      

  8.   

    While true and false might appear to be keywords, they are technically Boolean literals  Similarly, while null might appear to be a keyword, it is technically the null literal  
    ^_^,_____________________________________________________________________
    哈哈^_^,呵呵,这说明了什么呢?
    说明了true false null是一种特别的量,是java常规下的特例^_^
    总结一下
    我错了"true false null是关键字"//sun说她很象^_^
    你错了"常量不能做为命名"//sorry,常识
      

  9.   

    在程序设计方法中是这样说的: 实际上一种语言中有两种保留标识符,一种是关键字,如if, throws等等,另一种不叫关键字, 通常叫系统标识符,就如: true,false等,有的语言允许用户使用它们再定义为用户标识符,如PASCAL语言,而有些语言不允许,如JAVA.
      

  10.   

    呵呵,sun的东西总是有点模糊。给分