자바[Java] - java.lang.ArrayIndexOutOfBoundsException


자바[Java] - java.lang.ArrayIndexOutOfBoundsException

java.lang.ArrayIndexOutOfBoundsException Java를 하면서 제일 쉽게 볼 수 있는 예외 중 하나이다. 중요 포인트는 "IndexOutOfBoundsException" 이 부분으로 인덱스가 범위를 벗어나서 생긴 예외이다. public static void main(String[] args){ // String 배열 String[] arr = {"A","B","C"}; // 배열값 System.out.println(arr[0]); System.out.println(arr[1]); System.out.println(arr[2]); System.out.println(arr[3]); } ------------------------------------ // ArrayIndexOutOfBoundsException 에러 문구 Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: Index 3 o...


#exception #indexoutofboundsexception #에러

원문링크 : 자바[Java] - java.lang.ArrayIndexOutOfBoundsException