class JMM125
{
static int i;
public static void main(
String args[]) {
for (i=1; i<3; i++) {System.out.print(i);} // 1
for (int i=1; i<3; i++) {System.out.print(i);} // 2
int i; // 3
for (i=0; i<2; i++) {System.out.print(i);} // 4
System.out.print(JMM125.i);
}}
For the above code why would the value of variable i increase to 3 and would not be 0? The answer to the above question is 1212013 and not 1212010