That's not ok. Post increment first evaluate the variable, then increments.

So, if you have

int a=0

System.out .... (a++) //Print 0
System.out .... (++a) //Print 2