well, as far as your first program is concerned. The sequence of operation is as follows:
1)take the value i==0; OK
2)now (i++) means first assign i to i and then increment the value, so i is again 0; OK
3)now, first printing will show i=0; OK
4)again, the value of i==0;OK (because the value of i is overwritten with current value 0)
5)now again (i++) means first assign the current value of i to i and then do the increment, so i is again 0; OK
6)finally printing this value of i which shows i as 0; OK
for further clarification see the following:
http://www.javaranch.com/ubb/Forum24/HTML/005742.html bye,
Tualha Khan