If I understood your problem correctly, in your class the execution of for loop
is same in both the cases, i.e, first i=0, then it increments i to 1 since u
gave i++ and checks for i<2 and continue like. The difference is in 'a', value
Ist loop, when i=0, since it is a++ in ur print statement, a=1 in output, after
that it is incremented to 2 . so when i=1, a=2 in output, after which is
incremented to 3.
2nd loop, when i=0, since it is ++a in ur print statement, it is incremented to
2, so u get output as 2. When i=1, it is again incremented to 3 and output u get
is 3.