盾怪网教程:是一个免费提供流行杀毒软件教程、在线学习分享的学习平台!

Java基础之关键字

时间:2024/12/3作者:未知来源:盾怪网教程人气:

[摘要]1, which of the following are keywords or reserved words in java? a) if b)then c)goto d)while e)cas...
1, which of the following are keywords or reserved words in java?
a) if b)then c)goto d)while e)case f)sizeof

2, which of the following are java key words?
a)double b)Switch c)then d)instanceof

3, which of these are key words in java?
a) default b)NULL c)String d)throws e)long f)true

答案来了 1,acde 2,ad 3,adef 

解释来了 1,then和sizeof都不是java的关键字
2,所有的关键字都是小写的,所以Switch不是关键字。instanceof看上去像方法名,但其实是关键字;

3,大写的NULL不是java语言的关键字。String是java语言的一个封装类的类名,也不是关键字。

再来点系统的:

正确识别java语言的关键字(keyword)和保留字(reserved word)是十分重要的。Java的关键字对java的编译器有特殊的意义,他们用来表示一种数据类型,或者表示程序的结构等。保留字是为java预留的关键字,他们虽然现在没有作为关键字,但在以后的升级版本中有可能作为关键字。

关键字列表

abstract boolean break byte case
catch char class continue default
do double else extends false
final finally float for if
implements import instanceof int interface
long native new null package
private protected public return short
static super switch synchronized this
throw throws transient true try
void volatile while 

保留字
&n bsp;const,goto

注意点

识别java语言的关键字,不要和其他语言如c/c++的关键字混淆。
 
const和goto是java的保留字。
所有的关键字都是小写
friendly,sizeof不是java的关键字


关键词:Java基础之关键字




Copyright © 2012-2018 盾怪网教程(http://www.dunguai.com) .All Rights Reserved 网站地图 友情链接

免责声明:本站资源均来自互联网收集 如有侵犯到您利益的地方请及时联系管理删除,敬请见谅!

QQ:1006262270   邮箱:kfyvi376850063@126.com   手机版