java通过下划线数字字面量增加可读性:10_00_00表示100000

用法

    int x1  = 2_014;     // Underscore in  deciaml format
int x2  = 2___014;   // Multiple consecutive underscores 
int x3  = 02_014;    // Underscore in  octal literal
int x4  = 0b0111_1011_0001;  // Underscore in binary literal
int x5  = 0x7_B_1;           // Underscores in hexadecimal literal 
byte b1 = 1_2_7;             // Underscores in decimal format 
double d1 = 2_014.01_11;     // Underscores in double literal

https://blog.csdn.net/qq_27789551/article/details/52014372
https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html

posted @ 2019-10-26 22:46  脚本小娃子  阅读(1419)  评论(0编辑  收藏  举报