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
Maybe worth your while looking at the at Java documentation