switch
-
[JAVA] 조건문JAVA 2023. 7. 11. 21:22
/*if문 예시*/ public class Test { public static void main(String[] args) throws Exception { int num1 = 20; int num2 = 10; if (num1 > num2){ System.out.println("num1 값이 더 크다"); if(num2 > 5){ System.out.println("num2 값은 5보다 크다"); } } if(num1 < 10) System.out.println("num1 값은 10미만이다, num1:" + num1); else if(num1 < 20) System.out.println("num1 값은 20미만이다, num1:" + num1); else if(num1 < 30) System.out.pr..