JAVA標識符和關鍵字

來源:互聯網
上載者:User

標籤:prot   private   for   protected   ret   ade   style   其他   字元   

一、標識符     概念:就是用於給程式中的變數、類、方法命名的符號;     標識符規則:標識符可以有字母、數字、底線_、和貨幣符號$組成,並且數字不能打頭                 標識符不能使java關鍵字和保留字,但可以包含關鍵字和保留字                 標識符不能包含空格                 標識符只能包含貨幣符號$,不能包含@、#等其他特殊字元     分隔字元:分號; 花括弧{} 方括弧[] 括弧() 空格 圓點.;二、Java關鍵字    java中包含50個關鍵,所有關鍵字都是小寫    關鍵字列表:     abstract抽象的            assert      boolean                   break      byte                      case     catch                     char     const(保留字)             continue    default                    do     double                    else     enum                      extends     final                     finally     float                     for     if                        goto(保留字)     implements                import     int                       interface     long                      native     new                       package     private                   protected     public                    return      short                     static      strictfp                  super     switch                    synchronized     this                      throw     throws                    transient     try                       void      volatile                  while    the literals true,false,and null are lowercase,not uppercase as in the C++ language.Strictky speaking,these are not keyworrds but literals;however,the distinction is academic。      三個特殊的直接量(literal);true false null 都不是關鍵字,但這個區別只是學術上的。所以,它們不可以做為標識符。      轉載於:http://www.cnblogs.com/fkrcode/p/6006386.html

JAVA標識符和關鍵字

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.