Answers for "break continue"

7

break java

//Conclusion
        break == jump out side the loop
        continue == next loop cycle
        return == return the method/end the method.
          
  for(int i = 0; i < 5; i++) {
      System.out.println(i +"");
      if(i == 3){
        break;
        
      }
    }
  System.out.println("finish!");
/* Output
0
1
2
3
finish!
*/
Posted by: Guest on November-13-2020
1

break continue

The break statement "jumps out" of a loop.
The continue statement "jumps over" one iteration in the loop.
Posted by: Guest on December-23-2020

Browse Popular Code Answers by Language