APIdia Launch Partner
Top Description Fields Constructors
java.lang

public Class StringIndexOutOfBoundsException

extends IndexOutOfBoundsException
Class Inheritance

Thrown by String methods to indicate that an index is either negative or greater than the size of the string. For some methods such as the charAt method, this exception also is thrown when the index is equal to the size of the string.
Since
1.0
See Also
java.lang.String#charAt(int)

Field Summary

Modifier and TypeField and Description
private static final long

Constructor Summary

AccessConstructor and Description
public
StringIndexOutOfBoundsException()

Constructs a StringIndexOutOfBoundsException with no detail message.

public
StringIndexOutOfBoundsException(String
the detail message.
s
)

Constructs a StringIndexOutOfBoundsException with the specified detail message.

public
StringIndexOutOfBoundsException(int
the illegal index.
index
)

Constructs a new StringIndexOutOfBoundsException class with an argument indicating the illegal index.

Field Detail

serialVersionUIDback to summary
private static final long serialVersionUID

Hides java.lang.IndexOutOfBoundsException.serialVersionUID.

Annotations
@Serial

Constructor Detail

StringIndexOutOfBoundsExceptionback to summary
public StringIndexOutOfBoundsException()

Constructs a StringIndexOutOfBoundsException with no detail message.

StringIndexOutOfBoundsExceptionback to summary
public StringIndexOutOfBoundsException(String s)

Constructs a StringIndexOutOfBoundsException with the specified detail message.

Parameters
s:String

the detail message.

StringIndexOutOfBoundsExceptionback to summary
public StringIndexOutOfBoundsException(int index)

Constructs a new StringIndexOutOfBoundsException class with an argument indicating the illegal index.

The index is included in this exception's detail message. The exact presentation format of the detail message is unspecified.

Parameters
index:int

the illegal index.