When does the ArrayIndexOutOfBoundsException occur? *
Answers
Answered by
15
Explanation:
ArrayIndexOutOfBoundsException occurs when the index is either negative or greater than or equal to the size of the array.
Answered by
0
ArrayIndexOutOfBoundsException occurs when the index is either negative or greater than or equal to the size of the array.
- Additionally, certain checking happens at runtime. So, ArrayIndexOutOfBoundsException could be a runtime exception.
- Therefore, we want to be additional careful once accessing the boundary parts of the associate array. the foremost common mistake which will happen when accessing an associate array is forgetting the higher and lower bounds.
- The edge of the associate array is often zero, whereas the edge is one but its length. Accessing the array parts out of those bounds would throw associate ArrayIndexOutOfBoundsException.
#SPJ2
Similar questions