반응형 SMALL Else1 if, else if, else 기본 구조 if (조건1) { // 조건1이 true일 때 실행} else if (조건2) { // 조건1은 false이고, 조건2가 true일 때 실행} else { // 위의 모든 조건이 false일 때 실행}예제 1: 시험 점수 판별int score = 85;if (score >= 90) { System.out.println("A 학점");} else if (score >= 80) { System.out.println("B 학점");} else if (score >= 70) { System.out.println("C 학점");} else { System.out.println("재시험 대상입니다");} 출력 결과: B 학점흐름 설명위에서부터 조건을 하나씩 검사처음.. 2025. 4. 12. 이전 1 다음 LIST