java for loop pre-increment vs post-increment
- by rails_guy
for (int i = 0; i < 3; ++i)
System.out.print(i + ".."); //prints 0..1..2
for (int i = 0; i < 3; i++)
System.out.print(i + ".."); //prints 0..1..2
So what is the difference? in what cases can the pre-increment be used wrongly or by mistake which causes a bug...