Exception 3

Java_예외 - 예외의 우선순위

https://www.youtube.com/watch?v=lSopXBjhBHo public class ExceptionApp { public static void main(String[] args) { System.out.println(1); int[] scores = {10,20,30}; try { System.out.println(2); System.out.println(scores[3]); System.out.println(3); // System.out.println(2 / 0); System.out.println(4); } catch(ArithmeticException e){ System.out.println("계산이 잘못된 것 같아요."); } catch(Exception e){ // Exce..

Java_예외 - 예외의 처리

https://www.youtube.com/watch?v=YNRANQPuDjM public class ExceptionApp { public static void main(String[] args) { System.out.println(1); int[] scores = {10,20,30}; try { System.out.println(2); System.out.println(scores[3]); // 여기까지만 실행, 밑에는 건너뛰고 끝남 System.out.println(3); System.out.println(2 / 0); System.out.println(4); } catch(ArithmeticException e){ System.out.println("잘못된 계산이네요."); } catch(Arr..