Java7开始,数字字面量可以加下划线(方便人类区分)
public class HelloWorld {
public static void main(String []args) {
System.out.println(1_000_000);
System.out.println(0b1111_0100_0010_0100_0000);
System.out.println(0xf_42_40);
System.out.println(03_641_100);
}
}
double x = 999_999.99;
System.out.println(x);