Selasa, 27 Juli 2021

Why use Underscore in Numbers from Java? Underscore in Numeric Literals Example

JDK 1.7 release had introduced several useful features, despite most of them being syntactic sugar, there use can greatly improve readability and code quality. One such feature is the introduction of underscores in numeric literals. From Java 7 onwards you can write a long digit e.g. 10000000000 to a more readable 10_000_000_000 in your Java source code. One of the most important reasons for using an underscore in numeric literal is avoiding subtle mistakes that are hard to figure out by looking at code. It's hard to notice a missing zero or extra zero between 10000000000 and 1000000000, than 10_000_000_000 and 1_000_000_000.

Lorem ipsum is simply dummy text of the printing and typesetting industry.

Comments


EmoticonEmoticon