您的位置:首页技术文章
文章详情页

Java基础之―关键字

浏览:2日期:2024-06-22 17:35:47
内容: 呵呵,不管别的,来几条题目先,作对了你牛^_^1, which of the following are keywords or reserved words in java?a) if b)then c)goto d)while e)case f)sizeof2, which of the following are java key words? a)double b)Switch c)then d)instanceof3, 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 casecatch char class continue defaultdo double else extends falsefinal finally float for ifimplements import instanceof int interfacelong native new null packageprivate protected public return shortstatic super switch synchronized thisthrow throws transient true tryvoid volatile while 保留字const,goto注意点 识别java语言的关键字,不要和其他语言如c/c++的关键字混淆。 const和goto是java的保留字。 所有的关键字都是小写 friendly,sizeof不是java的关键字 小篇结束,下回说别的,(砖头+鸡蛋),不说别的难道还说这个,晕^_^。 Java, java, J2SE, j2se, J2EE, j2ee, J2ME, j2me, ejb, ejb3, JBOSS, jboss, spring, hibernate, jdo, struts, webwork, ajax, AJAX, mysql, MySQL, Oracle, Weblogic, Websphere, scjp, scjd
标签: Java
相关文章: