Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
結果はどうなりますか?
int i=1_00_00; int b=0b1_00;
アンダースコアは表示されますか?
if(i.equals(10000)){ System.out.println(i); }
2進数を10進数に変換しますか?
if(b.equals(8)){ System.out.println(b); }
は_、読みやすさを向上させるためだけに存在します。またはプリミティブを使用する.equals任意のメソッドを使用できます。値を出力するだけで、最初に値を確認する必要はありません。
_
.equals
アンダースコアを表示しますか?
プリミティブにアンダースコアを格納する方法はありません (char ch = '_' を除く)。
すべての数値は 2 進数で格納されるため、これは新しいことではありません。;)