From the program below or here, why does the last call to System.out.println(i) print the value 7?
class PrePostDemo {
public
Why wouldn't the variable have been updated?
The lines where you don't do anything with i make no difference.
Notice that this is also true for assignments:
i = 0;
test = ++i; // 1
test2 = i++; // 1