文章詳情頁
Java基礎之―關鍵字
瀏覽:3日期: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
相關文章:
排行榜