These are two java programs on a postincrement and preincrement operators being used on a for loop .both produces the same output.Then what is the difference between using preincrement and postincrement operators on a for loop.
public class Printi{
public static void main(String args[])
  {
  int i=0;
  for(i=0;i<5;++i){
  System.out.println(i);
  }
  }
}
produces output
C:\fx>java Printi
0
1
2
3
4
And this postincrement operator in for loop also produces same output
public class Printj{
public static void main(String args[])
  {
  int j=0;
  for(j=0;j<5;j++){
  System.out.println(j);
  }
  }
}
C:\fx>java Printj
0
1
2
3
4