Package java.lang

Class IndexOutOfBoundsException

All Implemented Interfaces:
Serializable
Direct Known Subclasses:
ArrayIndexOutOfBoundsException, StringIndexOutOfBoundsException

public class IndexOutOfBoundsException
extends RuntimeException
Thrown when a program attempts to access a value in an indexable collection using a value which is outside of the range of valid indices.
See Also:
Serialized Form
  • Constructor Details

    • IndexOutOfBoundsException

      public IndexOutOfBoundsException()
      Constructs a new IndexOutOfBoundsException that includes the current stack trace.
    • IndexOutOfBoundsException

      public IndexOutOfBoundsException​(String detailMessage)
      Constructs a new IndexOutOfBoundsException with the current stack trace and the specified detail message.
      Parameters:
      detailMessage - the detail message for this exception.