Can you explain to me the output of this Java code?
int a=5,i; i=++a + ++a + a++; i=a++ + ++a + ++a; a=++a + ++a + a++; System.out.println(a); System.out.p
when a is 5, then a++ gives a 5 to the expression and increments a afterwards, while ++a increments a before passing the number to the expression (which gives a 6 to the expression in this case).
a
a++
++a
So you calculate
i = 6 + 7 + 7 i = 5 + 7 + 8