Why does the statement (1_0 == 10) evaluate to true? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why does the statement (1_0 == 10) evaluate to true?

Saw this in a challenge and I was really confused that this statement evaluates to true. Tried it only in Java so idk if it works in other languages to, therefore the Java tag.

15th May 2019, 3:41 PM
Daniel Mƶhring
Daniel Mƶhring - avatar
1 Resposta
+ 3
_ (in java) is used just for the purpose of increasing readability. eg- like in real life we can write 1000 as 1,000 ( , here doesn't mean anything)
15th May 2019, 4:07 PM
kiRA
kiRA - avatar