Notice
Recent Posts
Recent Comments
Link
목록Thread (1)
semtax의 개발 일지
자바 Uncaught Exception 캐치 하기
개요 이번 포스팅에서는, 자바의 모든 예외(Exception)을 한번애 전부 캐치 할 수 있는 방법에 대해서 포스팅을 하도록 하겠다. 자바 예외 처리 자바에서는 보통 아래와 같이 try-catch 문을 이용해서 에러를 핸들링 할 수 있다. public class ExampleClass { public static void main(String[ ] args) { try { int[] numbers = {1, 2, 3}; System.out.println(numbers[10]); } catch (Exception e) { System.out.println("Exception is occured!"); } } } 또한, throws 를 이용해서 예외를 다른곳으로 전파 할 수도 있다. (보통 해당 클래스를 호..
개발/Java
2020. 5. 5. 14:58