I got confused in the post ++ and pre ++ operator, for example in the following code
int x = 10; x = x++; sysout(x);
will print 10?
He types 10, but I expected him to type 11
but when i do
x = ++x; instead of x = x++;
it will print eleven, as I expected, so why x = x ++; does not change the value of x?
java increment post-increment pre-increment
user3803547
source share