you cannot place underscores in the following places:
At the beginning or end of a number...
此外,他們都給予了例子來
int x1 = _52; // This is an identifier, not a numeric literal
當我在我的代碼中使用它,它沒有給任何編譯時錯誤
long l = _23L;
我們可以在開始時使用_
嗎? 是什麼由
This is an identifier, not a numeric literal
對不起意思是,如果它確實是一個愚蠢的問題,我還沒有從很久修訂的Java基礎知識。
編輯:
我使用Windows XP和Java 7
java version "1.7.0_02"
Java(TM) SE Runtime Environment (build 1.7.0_02-b13)
Java HotSpot(TM) Client VM (build 22.0-b10, mixed mode, sharing)
你使用什麼編譯器,以及在哪個操作系統?這確實會給編譯錯誤,但正如Rajendran T所指出的,不是類型錯誤,而是未知變量。 – mgibsonbr
@mgibsonbr:請檢查我的編輯。 – xyz