Click to enter _ more _java thousand ask
1. Why underline in numeric value
This is a feature after JDK 7.
Starting with JDK 7, you can insert one or more underscores in numeric literals, including integer literals and floating-point literals. For example:
int x = 123_456_789;
When compiling, the underscore is automatically removed. However, the underscore can only be used to separate numbers, cannot delimit characters and characters, and cannot delimit characters and numbers.
The underscore can be used consecutively, for example:
float f = 1.22___33__44;
The literal value of binary or hexadecimal can also use underscores.
Remember that underscores can only be used between numbers and numbers, and are illegal for the first time. For example: 1._23 is illegal, _123, 11000_l are also illegal.
Learn about the basic data types of JAVA8:8 basic data types for Java
Java technology _java Thousands of questions (0046) _ Why underline in numeric values