[Chapter 12] IndexOutOfBoundsException
Author: Mark Grand and Jonathan Knudsen
Date: Fri Aug 8 17:01:54 1997

#

| Chapter 12 The java.lang Package |

# IndexOutOfBoundsException

## Name

IndexOutOfBoundsException

## Synopsis

Class Name:

  `java.lang.IndexOutOfBoundsException`

Superclass:

  `java.lang.RuntimeException`

Immediate Subclasses:

  `java.lang.ArrayIndexOutOfBoundsException`, `java.lang.StringIndexOutOfBoundsException`

Interfaces Implemented:

  None

Availability:

  JDK 1.0 or later

## Description

The appropriate subclass of `IndexOutOfBoundsException` is thrown when an array or string index is out of bounds.

## Class Summary

    public class java.lang.IndexOutOfBoundsException
                 extends java.lang.RuntimeException {
      // Constructors
      public IndexOutOfBoundsException();
      public IndexOutOfBoundsException(String s);
    }

## Constructors

### IndexOutOfBoundsException

#### public IndexOutOfBoundsException()

Description

  This constructor creates an `IndexOutOfBoundsException` with no associated detail message.

#### public IndexOutOfBoundsException(String s)

Parameters

  `s`

    The detail message.

Description

  This constructor creates an `IndexOutOfBoundsException` with the specified detail message.

## Inherited Methods

Method | Inherited From | Method | Inherited From
--- | --- | --- | ---
`clone()` | `Object` | `equals(Object)` | `Object`
`fillInStackTrace()` | `Throwable` | `finalize()` | `Object`
`getClass()` | `Object` | `getLocalizedMessage()` | `Throwable`
`getMessage()` | `Throwable` | `hashCode()` | `Object`
`notify()` | `Object` | `notifyAll()` | `Object`
`printStackTrace()` | `Throwable` | `printStackTrace(PrintStream)` | `Throwable`
`printStackTrace(PrintWriter)` | `Throwable` | `toString()` | `Object`
`wait()` | `Object` | `wait(long)` | `Object`
`wait(long, int)` | `Object` |  |

## See Also

`ArrayIndexOutOfBoundsException`, `Exception`, `RuntimeException`, `StringIndexOutOfBoundsException`, `Throwable`

IncompatibleClassChangeError |  | Integer