[Java] 제어문 (if, switch/case, while, for, for each)
1. if123456789if (조건문) { ...} else { ...}cs 12345678910111213if (조건문) { ...}else if (조건문) { ...} else { ... }cs 2. switch/case123456789switch(입력변수) { case 입력값1: ... break; case 입력값2: ... break; ... default: ... break;}cs 3. while12345678910while (조건문) { ... if (조건문) { continue; // 수행 문장3을 skip하고 while 조건문으로 } } Colored by Color Scriptercs 12345678while (true) { ... if (조건문) { break; // while문 빠져..
Web/JAVA
2019. 4. 18. 23:05