Java關鍵字和標識符

來源:互聯網
上載者:User

標籤:英文字母   long   extends   限制   float   命名   for   nal   不能   

一、關鍵字

     被Java語言賦予了特殊含義,用做專門用途的字串(單詞)  注意:關鍵字中所有字母都為小寫

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

     Java保留字:現有Java版本尚未使用,但以後版本可能會作為關鍵字使用。自己命名標記符時要避免使用這些保留字 

          byValue、cast、future、 generic、 inner、 operator、 outer、 rest、 var 、 goto 、const

二、標識符

     Java 對各種變數、方法和類等要素命名時使用的字元序列稱為標識符

定義合法標識符規則:

  • 由26個英文字母大小寫,0-9 ,_或 $ 組成
  • 數字不可以開頭。
  • 不可以使用關鍵字和保留字,但能包含關鍵字和保留字。
  • Java中嚴格區分大小寫,長度無限制。
  • 標識符不能包含空格。

 

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.