+ 1
why is this true?
int x=1; System.out.print(++x==x);
5 odpowiedzi
+ 8
because ++x increases x to 2, and after that, x will still be == x (2==2).
+ 6
we know the precidence of ( ++) operator is highest priority then (==) operator so first increment the value of x that is why in memory location x became 2 and then (==) operator execute (2==2) that is true
+ 3
tnx
+ 1
(2==2)
0
2==2