break
코드 | 출력값 |
public class test { public static void main(String[] args) { for (int a=0; a<10; a++) { if(a==5) break; System.out.println("Coding Everybody"+a); } } } |
Coding Everybody0 Coding Everybody1 Coding Everybody2 Coding Everybody3 Coding Everybody4 |
continue
코드 | 출력값 |
public class test { public static void main(String[] args) { for (int a=0; a<10; a++) { if(a==5) continue; System.out.println("Coding Everybody"+a); } } } |
Coding Everybody0 Coding Everybody1 Coding Everybody2 Coding Everybody3 Coding Everybody4 Coding Everybody6 Coding Everybody7 Coding Everybody8 Coding Everybody9 |
댓글