ap.java.lang
Class ArrayIndexOutOfBoundsException
java.lang.Object
java.lang.Throwable
java.lang.Exception
java.lang.RuntimeException
java.lang.IndexOutOfBoundsException
ap.java.lang.ArrayIndexOutOfBoundsException
- All Implemented Interfaces:
- java.io.Serializable
- public class ArrayIndexOutOfBoundsException
- extends java.lang.IndexOutOfBoundsException
Students should understand this error/exception
when it occurs in a program.
An object of this class is thrown when code accesses an array
with an illegal index. This happens when an index is negative or
greater than or equal to the length of the array being indexed.
For example:
int[] list = new int[5];
list[5] = 33; // illegal index, maximum index is 4
- See Also:
- Serialized Form
Methods inherited from class java.lang.Throwable |
fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toString |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException()