user17702
0
Q:

what does the continue keyword do in java

int i = 0;
while (i < 10) {
  if (i == 4) {
    i++;  //why do I need this line ?
    continue;
  }
  System.out.println(i);
  i++;
}
1
   int number = 4;
        int finalnum = 20;
        while(number <= finalnum){
            number++;
            if(number %2 != 0){//Each odd number restarts the loop
              continue;
            }
            System.out.println("Even Number!: "+ number);
        }
    }//EOM
0

New to Communities?

Join the community