Beruflich Dokumente
Kultur Dokumente
8-1
One-Dimensional Arrays
Section 8
Indices
0 1 2 3 4 5 6
27 12 82 70 54 1 30
Elements
Indices
0 1 2 3 4 5 6
27 12 82 70 54 1 30
Elements
Section 8
Section 8
• If
theansize
index is either
of the array,negative
then theorarray
greater than
index or equal
is out of to
bounds.
• If an array index is out of bounds, the JVM throws an
ArrayIndexOutOfBoundsException.
• This is called automatic bounds checking.