Back

Explore Courses Blog Tutorials Interview Questions
0 votes
1 view
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 in Java by dante07 (13.1k points)
0 votes
1 answer
0 votes
1 answer
0 votes
0 answers
asked Dec 31, 2020 in Python by Dacarii (120 points)
Welcome to Intellipaat Community. Get your technical queries answered by top developers!

28.4k questions

29.7k answers

500 comments

94k users

Browse Categories

...