Development/Java
java - 예외처리 - java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
linuxism
2012. 8. 3. 02:30
java.lang.IndexOutOfBoundsException: Index: 1, Size: 1
배열처리에서 나는 에러로..
배열의 값이 1개가 있는데..2개를 불러올떄 발생한다.
(int i=0; i <= boardList.size() i++){
}
boardList.size() 가 1 인데, 디버깅 결과 두번돌앗다...
(int i=0; i < boardList.size() i++){
}
위와 같이수정후 이상없음...
사이즈랑 작거나 같다고 해서 1인데 두번 실행을 했다
출처 - http://enfold.tistory.com/11
그방법은 해봤구요
한번도 객체가 들어가지 않은 ArrayList는 get(Index)를 하면
java.lang.IndexOutOfBoundsException: Index: 0, Size: 0
라고 Exception이 발생합니다.
출처 - http://www.okjsp.pe.kr/seq/63439