0
System.out.print(1_0 ==10); Ans: true
When I compiled this line Ans is always true.. I didn't understand the concept behind it!!! Anyone Pls help!!!
2 Respostas
+ 5
Underscores were introduced in Java to enhance readability of large numbers and it is completely legal to use. There is no difference between them. The compiler just ignores the underscore.
+ 5
Numeric literals in Java can contain underscore, as long as it is not directly next to the decimal separator.
This feature is supposed to make it easier to write / read long numbers, like you can write two millions as 2_000_000 instead of 2000000
Easier to read right?