Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in Java by (6.5k points)
edited by
Could someone tell me why am I getting an ArrayIndexOutOfBoundsException message upon execution?

1 Answer

0 votes
by (11.3k points)
edited by

Suppose you have an integer array of 10 elements indexed from 0...9. When you try to refer or call for the 10th index, an ArrayIndexOutofBoundsException is thrown. This means that the index number that you are calling for doesn't contain anything and is 'out of bounds' for the integer array. You can resolve this error by using throw and catch for this specific condition or binding the iterative variables and limiting them to remain within the array length limits. 

Related questions

0 votes
1 answer
asked Apr 14, 2021 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...