码迷,mamicode.com
首页 > 编程语言 > 详细

java中的关键字

时间:2015-02-11 12:34:31      阅读:159      评论:0      收藏:0      [点我收藏+]

标签:

7、以下不是java关键字的有【C】 。

A. super   B. this   C. NULL   D. true

正确答案是CD,今天做了一个简单的java测试题结果让我凌乱了,用了这么长时间的java,一直以为true也是java的关键字,因为用任何编辑工具里面true,false,null都是会变色的,结果今天才发现java里面认为true,false,null不是一个关键字,而是 literals字面值。这也是前sun公司规定的,没有原因,既然要玩java这个游戏就需要遵守人家的规定!

 

下面是从http://docs.oracle.com/javase/tutorial/java/nutsandbolts/_keywords.html网页复制的,可以参考!

Java Language Keywords

Here is a list of keywords in the Java programming language. You cannot use any of the following as identifiers in your programs. The keywords const and goto are reserved, even though they are not currently used. true, false, and null might seem like keywords, but they are actually literals; you cannot use them as identifiers in your programs.

abstract continue for new switch
assert*** default goto* package synchronized
boolean do if private this
break double implements protected throw
byte else import public throws
case enum**** instanceof return transient
catch extends int short try
char final interface static void
class finally long strictfp** volatile
const* float native super while
*   not used
**   added in 1.2
***   added in 1.4
****   added in 5.0

java中的关键字

标签:

原文地址:http://www.cnblogs.com/zfy-220/p/4285690.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!