๐Debugging Story
[Java] IndexOutOfBoundsException: Index: 10, Size: 10
๋ฃจ๋ฆฌ์ผใ
2023. 12. 22. 16:53
๋ฐ์ํ
IndexOutOfBoundsException: Index: 10, Size: 10
ArrayList์์ ์์ฐจ์ ์ผ๋ก Array๋ฅผ ๊ฐ์ ธ์ค๋ ๊ณผ์ ์์ ์๋ฌ๊ฐ ๋ฌ๋ค.
์์ธ
Array๋ 10๊ฐ์ธ๋ฐ index๋ 9๊น์ง์ผ ํ๋ ๋ฐ 10์ด ๋ค์ด๊ฐ๊ธฐ ๋๋ฌธ์ ๋ ์๋ฌ์๋ค.
ํด๊ฒฐ๋ฐฉ๋ฒ
ํด๋น ํจ์์์ Array ํฌ๊ธฐ๋งํผ ๋ถ๋ฌ์ฌ ์ ์๋๋ก ์์ ํ๋ค...
if(currentIndex == quizArrayList.size()-1){
return;
}
๋ฐ์ํ