+ 1

Why its giving error? And not increamenting x twice?

public class Program { public static void main(String[] args) { int x = 34; int y =(++ (++x)); System.out.println(y); } }

24th Mar 2020, 9:46 PM
Ana
5 Respostas
+ 3
it because parentheses Mireille has right too
24th Mar 2020, 9:59 PM
Oneill~ĐžĐœĐ”ĐžĐ»Đ»~ć„„ć°Œć°”~à€“à€šà„€à€Č~Ű§ÙˆÙ†ÛŒÙ„~*‎
Oneill~ĐžĐœĐ”ĐžĐ»Đ»~ć„„ć°Œć°”~à€“à€šà„€à€Č~Ű§ÙˆÙ†ÛŒÙ„~*‎ - avatar
+ 2
hi, because first increment is ok inside (..(++x)) but second is (++35) the new value not (++x)
24th Mar 2020, 9:54 PM
Oneill~ĐžĐœĐ”ĐžĐ»Đ»~ć„„ć°Œć°”~à€“à€šà„€à€Č~Ű§ÙˆÙ†ÛŒÙ„~*‎
Oneill~ĐžĐœĐ”ĐžĐ»Đ»~ć„„ć°Œć°”~à€“à€šà„€à€Č~Ű§ÙˆÙ†ÛŒÙ„~*‎ - avatar
+ 1
Oneill.....but what's the reason?
24th Mar 2020, 9:56 PM
Ana
24th Mar 2020, 10:00 PM
Ana