java.lang.ArrayIndexOutOfBoundsException

ChoiYoungHeon·2022년 3월 5일
0

Java Error

목록 보기
1/1

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException:

선언된 배열의 크기를 벗어날때 나타나는 오류입니다.

int[] arr = {11, 22, 33, 44, 55};
//11은 0번째, 22는 1번째....55는 4번째

System.out.println(arr[4]); //결과는 55
System.out.println(arr[5]); //Error
profile
무작정 해봐

0개의 댓글