java.lang.arrayoutofboundexception length:10 index:10

The first value in an array has the index [0] and so the tenth will be at [9], not [10]. If you attempt to reference array[array.length] (in your case array[10]) you will encounter an exception

enter image description here

Maybe worth your while looking at the at Java documentation

Leave a Comment