文章詳情頁
Java基礎(chǔ)之―關(guān)鍵字
瀏覽:24日期:2024-06-22 17:35:47
內(nèi)容: 呵呵,不管別的,來幾條題目先,作對了你牛^_^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的關(guān)鍵字,熟悉c或者c++,寫慣了asp的高手就要小心嘍。2,所有的關(guān)鍵字都是小寫的,所以Switch不是關(guān)鍵字。instanceof看上去像方法名,但其實是關(guān)鍵字;3,大寫的NULL不是java語言的關(guān)鍵字。String是java語言的一個封裝類的類名,也不是關(guān)鍵字。再來點系統(tǒng)的: 正確識別java語言的關(guān)鍵字(keyword)和保留字(reserved word)是十分重要的。Java的關(guān)鍵字對java的編譯器有特殊的意義,他們用來表示一種數(shù)據(jù)類型,或者表示程序的結(jié)構(gòu)等。保留字是為java預(yù)留的關(guān)鍵字,他們雖然現(xiàn)在沒有作為關(guān)鍵字,但在以后的升級版本中有可能作為關(guān)鍵字。關(guān)鍵字列表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語言的關(guān)鍵字,不要和其他語言如c/c++的關(guān)鍵字混淆。 const和goto是java的保留字。 所有的關(guān)鍵字都是小寫 friendly,sizeof不是java的關(guān)鍵字 小篇結(jié)束,下回說別的,(磚頭+雞蛋),不說別的難道還說這個,暈^_^。 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
標(biāo)簽:
Java
相關(guān)文章:
排行榜

網(wǎng)公網(wǎng)安備