2015/02/161 [Java] 18. Exception , try catch - 예외 처리 Exception 이란 무엇일까? Exception의 뜻은 예외이다. 스크립트상에서 발생하는 예외적인 상황을 의미하는 것이다. 한번 예외에 대해 보자. public class ExceptionTest { public static void main(String args[]) { int [] arr = new int[3]; for(int i=0 ; i < arr.length ; i++) { arr[i] = i; } System.out.println(arr[4]); } } 이 스크립트를 실행하면 ArrayIndexOutOfBoundsException 이라는 예외가 발생된다. 배열의크기를 초과한 Index를 호출하려 하였기 때문이다. 이런 예외적인 상황이 발생하면 시스템이 중지될 수도 있다. 그러므로 예외가 발.. 2015. 2. 16. 이전 1 다음