26.01.2014, 12:48
The code.
The problem is the value that you put inside [ ] is invalid.
For example you created an array or a string with 10 character.
new array[10];
but your are trying to access an non-esisting element
array[15]; //this will give array index out of bounds error
NOTE:THe first element will be 0 not 1.And the last element will be the number that you put while declaring the array minus one.
In my example the first entry is array[0] and the last entry is [9]
array[10] is wrong.
The problem is the value that you put inside [ ] is invalid.
For example you created an array or a string with 10 character.
new array[10];
but your are trying to access an non-esisting element
array[15]; //this will give array index out of bounds error
NOTE:THe first element will be 0 not 1.And the last element will be the number that you put while declaring the array minus one.
In my example the first entry is array[0] and the last entry is [9]
array[10] is wrong.