I want to know how the following code produces "-1" output.
class Demo1
{
public static void main(String[] arg)
{
int i,j;
for(i=-2,j=2;i++>0;j--)
{
i=++i;
}
System.out.print(i);
}
}
This above code produces output "-1", but how? Can anyone explain it? Thank you in advance!