java7新增的特性,可以使用_增強數字的可讀性,方式更優雅,簡單測試用例如下:
@Test
public void testNumberMoreZero() {
// 數字中可以使用下劃線分割,增強可讀性
long a = 1234_560;
long b = 600_000;
System.out.println(a);
System.out.println(b);
}
運行結果如下:
↓...start test...↓
1234560
600000
↑...end test...↑
Process finished with exit code 0