You’ve used i++ and ++i countless times.
But do you know what is the difference?
In this video, I break down the subtle (and often confusing) behavior of pre-increment and post-increment in Java. You’ll see exactly how Java evaluates each expression, and why something like i = i++ doesn’t behave the way most people expect.
We’ll cover:
What i++ (post-increment) really does
What ++i (pre-increment) does differently
an in which order java executes each of those operations.