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》 我想这能说明问题了吧
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,常识
String s="classjava";
classjava就是一个字符常量,但是她可以做为命名
你说的也不对啊
-------
如果说常量不能做命名的话
String s="classjava";
classjava就是一个字符常量,但是她可以做为命名
----------
classjava不是常量,"classjava"就是常量----------
由以上说推出,true,false,null就是java的关键字,
--------------
我以人格担保,你说的是错的
__________________________________
呵呵,的确你说这话就是错了,凡事都要就事论事,就楼主提出来的问题
true,false,null就是java的关键字
但是一个符号当然可以担当两个角色,但是不可以混为一谈
true,false,null在关键在boolean的定义下,是用作常量来定义逻辑变量的赋值,可以看成常量
_________________________________
对于你认为该东东是常量来判断不是关键字,这点我认为错了(呵呵,人都有错,我不想用人格来担保^_^)
________________________________________________
这一点你也说错了,classjava是常量,计算和操作的时候就用这个classjava
而"classjava"是做为常量表示,是一种表示形态,用来区别变量classjava哈哈
这又支持了常量也可以做为变量命名,强调命名
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》
我想这能说明问题了吧
^_^,_____________________________________________________________________
哈哈^_^,呵呵,这说明了什么呢?
说明了true false null是一种特别的量,是java常规下的特例^_^
总结一下
我错了"true false null是关键字"//sun说她很象^_^
你错了"常量不能做为命名"//sorry,常识