0
How the output of this code is 'i=0' ?
int i=0; while(i>0) { if(i==3) { break; } ++i; } System.out.println("i="+i);
1 Answer
+ 8
0 is assigned to i, 0 > 0 is false, so everything inside the while block is skipped and the output is
i=0
int i=0; while(i>0) { if(i==3) { break; } ++i; } System.out.println("i="+i);