I am trying to figure out why the following code gives two different results
I tried the followingL
int x = 4, y = 4;
System.out.println(x + --x);
System.out.println(--y + y);
And It outputs 7 6. From my knowledge, preincrement has a higher precendence than addition so it should decrease the value of x/y regardless of it's value in the expression but this is clearly not the case. Can anyone please explain this to me?