System.out.println(2_0==20); why answer is true | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

System.out.println(2_0==20); why answer is true

Java code output is true why

19th Feb 2019, 5:09 PM
Vishal G
Vishal G - avatar
1 Answer
+ 3
It's true, because "_" is used to separate the digits in a numerical literal to improve readability of the code. You can find more info here: https://docs.oracle.com/javase/7/docs/technotes/guides/language/underscores-literals.html Hope it helps you.
19th Feb 2019, 6:03 PM
TheWhĀ”teCat šŸ‡§šŸ‡¬
TheWhĀ”teCat šŸ‡§šŸ‡¬ - avatar