N/APosted on - 08/03/2011
While coding a java program, I have came across this strange error during the compilation of program saying "Java.lang.ArrayIndexOutOfBoundsException."
I am also pasting my specific fragment of code.
I will be very obliged if responded.
Experiencing Java.lang.Array Index Out Of Bounds Exception Error
This error indicates that array has been accessed by some illegal index.
Now what does illegal index name means here?
It means that you are trying to access an index of array which does not exist actually.
To solve this I will recommend you to go basic concepts of array. In java Array is basically an object.
Link may help you to understand.
You have to check that you are not referring any index which does not exist in your array. Remember that when you create array by writing
int intArray = new int;
The values of indexes will be from 0 to 9 for the above array.
So make sure that you are not referring index greater than i.e. 9 for the above example.
you can post your code.
Best of luck