APCS Java Subset

ap.java.lang
Class ArrayIndexOutOfBoundsException

java.lang.Object
  extended byjava.lang.Throwable
      extended byjava.lang.Exception
          extended byjava.lang.RuntimeException
              extended byjava.lang.IndexOutOfBoundsException
                  extended byap.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

Constructor Summary
ArrayIndexOutOfBoundsException()
           
 
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
 

Constructor Detail

ArrayIndexOutOfBoundsException

public ArrayIndexOutOfBoundsException()

unofficial documentation for the APCS Java Subset