반응형 SMALL switch1 switch 문 사용법 기본 구조switch (변수 or 식) { case 값1: // 값1일 때 실행할 코드 break; case 값2: // 값2일 때 실행할 코드 break; ... default: // 어느 case에도 해당되지 않을 때 실행} 예제 1: 요일 출력기int day = 3;switch (day) { case 1: System.out.println("월요일"); break; case 2: System.out.println("화요일"); break; case 3: System.out.println("수요일"); break; case.. 2025. 4. 12. 이전 1 다음 LIST