Assume int x = 1;
System.out.println(x++ + x); ---> Output:3
System.out.println(x++ - x); ---> Output:-1
System.out.println(x-- + x); ---> Output:1
System.out.println(x-- - x); ---> Output:1
x = x++;
System.out.println(x); ---> Output:1
Can anyone please explain how post-increment works?
Note: All print statements are executed independently.