java continue use of i++
Why does the loop stop when i don't have i ++ before the continue, and prints to the equivalent of if and then the cursor blinks? Does not print further while (i < 10) { if (i == 1) { i++; //if remove this line .... continue; } System.out.print("I am Continue" + i + "\n"); i++; } // Output /* I am Continue0 I am Continue2 I am Continue3 I am Continue4 I am Continue4 I am Continue5 I am Continue6 I am Continue7 I am Continue8 I am Continue9 I am Continue10 while (i < 10) { if (i == 1) { // i++; //if remove this line .... continue; } System.out.print("I am Continue" + i + "\n"); i++; } //output //I am Continue 0 |