What happens to post-increment when an exception is thrown?
array[i++] = foo(); and foo() throws an exception, i will be incremented anyway. This can cause problems if sometimes foo() throws an exception and you don’t want i incremented in cases when it does. This is a consequence of JLS 15.25.1 and 15.6.1 “the left-hand operand of a binary operator appears to be fully evaluated before any part of the right-hand operand is evaluated.” (assignment is taken as a binary operator). Note that this is not how C++ behaves.