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 閱讀(2189) 評論(0)  編輯  收藏 所屬分類: Java/j2se
          <2006年11月>
          2930311234
          567891011
          12131415161718
          19202122232425
          262728293012
          3456789

          常用鏈接

          留言簿(3)

          隨筆分類

          文章分類

          相冊

          網站鏈接

          搜索

          •  

          最新評論

          閱讀排行榜

          評論排行榜

          主站蜘蛛池模板: 兴隆县| 石嘴山市| 云阳县| 嘉兴市| 大丰市| 平陆县| 韶山市| 迭部县| 太保市| 全椒县| 兰考县| 衡阳市| 元阳县| 林芝县| 莫力| 城固县| 加查县| 拜城县| 夏河县| 安龙县| 儋州市| 钦州市| 博爱县| 寿阳县| 永仁县| 连平县| 故城县| 蒲城县| 金堂县| 张北县| 盐边县| 永安市| 米脂县| 永定县| 贡嘎县| 宁蒗| 正镶白旗| 武冈市| 嘉禾县| 资源县| 惠水县|