Package java.lang
Class ArrayIndexOutOfBoundsException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IndexOutOfBoundsException
-
- java.lang.ArrayIndexOutOfBoundsException
-
- All Implemented Interfaces:
Serializable
,Modified
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException implements Modified
Thrown when the an array is indexed with a value less than zero, or greater than or equal to the size of the array.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description ArrayIndexOutOfBoundsException()
Constructs a newArrayIndexOutOfBoundsException
that includes the current stack trace.ArrayIndexOutOfBoundsException(int index)
Constructs a newArrayIndexOutOfBoundsException
with the current stack trace and a detail message that is based on the specified invalidindex
.ArrayIndexOutOfBoundsException(int sourceLength, int index)
Used internally for consistent high-quality error reporting.ArrayIndexOutOfBoundsException(int sourceLength, int offset, int count)
Used internally for consistent high-quality error reporting.ArrayIndexOutOfBoundsException(String detailMessage)
Constructs a newArrayIndexOutOfBoundsException
with the current stack trace and the specified detail message.
-
Method Summary
-
Methods inherited from class java.lang.Throwable
getMessage, printStackTrace, printStackTrace, toString
-
-
-
-
Constructor Detail
-
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException()
Constructs a newArrayIndexOutOfBoundsException
that includes the current stack trace.
-
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(int index)
Constructs a newArrayIndexOutOfBoundsException
with the current stack trace and a detail message that is based on the specified invalidindex
.- Parameters:
index
- the invalid index.
-
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(String detailMessage)
Constructs a newArrayIndexOutOfBoundsException
with the current stack trace and the specified detail message.- Parameters:
detailMessage
- the detail message for this exception.
-
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(int sourceLength, int index)
Used internally for consistent high-quality error reporting.- Parameters:
sourceLength
- Length of array.index
- Array index.
-
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(int sourceLength, int offset, int count)
Used internally for consistent high-quality error reporting.- Parameters:
sourceLength
- Length of array.offset
- Array offset.count
- Array count.
-
-