Post + + operations, tested in JavaScript and Java
var k = 0;
K = k++;
Console.log (k); 0
//////////////////////////////////////////////////////////////////
int i = 0;
i = i++;
System.out.println (i);//0
Why the result is 0 instead of 1, the computer performs the second + + at the time of calculation,
If you need the result is 0, then need to use the front + +, this does not have to say, do not understand the test under their own
So let's look at one more case:
var k = 0;
k++;
Console.log (k);
What is the result of this? That's right, 1, don't get confused by the case above.
Why would that be?
The process of execution is top-down, then the second equals 1, which can understand
The first one is because the Post + + is executed later than the assignment, and when the discovery needs to be performed,
will be assigned to call first, after the execution of the + + operation, so you understand it
The next + + operation in development is a puzzle