+ 5

Java output - A strange equality

Why is 234 == 23_4? public class Program { public static void main(String[] args) { int x = 234; boolean y = (x==23_4); System.out.println(y); } }

7th Apr 2019, 6:54 AM
Paolo De Nictolis
Paolo De Nictolis - avatar
2 ответов
+ 6
Underscores in Numeric Literals https://www.sololearn.com/learn/478/?ref=app
8th Apr 2019, 3:50 PM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
0
I discovered is Ruby-like...
14th Apr 2019, 8:26 PM
Paolo De Nictolis
Paolo De Nictolis - avatar