posts - 11,  comments - 14,  trackbacks - 0

          <<Java Language Specification>>列出了java關鍵字、保留關鍵字,
          并舉例說明true,false和null都不是java的keywords,而是literals ,盡管他們看起來很像是keywords。

          3.9 Keywords

          The following character sequences, formed from ASCII letters, are reserved for use as keywords and cannot be used as identifiers (§3.8):

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

          The keywords const and goto are reserved, even though they are not currently used. This may allow a Java compiler to produce better error messages if these C++ keywords incorrectly appear in programs.

          While true and false might appear to be keywords, they are technically Boolean literals (§3.10.3). Similarly, while null might appear to be a keyword, it is technically the null literal (§3.10.7).

          3.10 Literals

          A literal is the source code representation of a value of a primitive type (§4.2), the String type (§4.3.3), or the null type (§4.1):

            						Literal:
            	IntegerLiteral
            	FloatingPointLiteral
            	BooleanLiteral
            	CharacterLiteral
            	StringLiteral
            	NullLiteral
            
            				


          ?

          posted on 2006-11-29 23:57 jinn 閱讀(2185) 評論(0)  編輯  收藏 所屬分類: Java/j2se
          <2006年11月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(3)

          隨筆分類

          文章分類

          相冊

          網站鏈接

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 保康县| 敖汉旗| 酒泉市| 正蓝旗| 汨罗市| 边坝县| 台湾省| 北票市| 峡江县| 沂源县| 三门县| 微山县| 黑龙江省| 繁昌县| 永兴县| 岳阳县| 江城| 梓潼县| 上饶市| 岚皋县| 邵东县| 台中市| 江山市| 新津县| 定日县| 呼玛县| 韶山市| 罗江县| 巴青县| 同德县| 吐鲁番市| 徐水县| 临漳县| 顺昌县| 福建省| 嘉祥县| 七台河市| 寿阳县| 刚察县| 德保县| 封丘县|