sizeof不是java关键字是_java基础之关键字

作者:matrix-stopno

呵呵,不管别的,来几条题目先,作对了你牛^_^

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的关键字,熟悉c或者c++,写惯了asp的高手就要小心喽。

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

保留字

const,goto

注意点

识别java语言的关键字,不要和其他语言如c/c++的关键字混淆。

const和goto是java的保留字。

所有的关键字都是小写

friendly,sizeof不是java的关键字

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值