public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException
String方法来指示索引为负或大于字符串的大小。
对于某些方法(如charAt方法),当索引等于字符串的大小时,也会抛出此异常。
String.charAt(int) ,
Serialized Form
| Constructor and Description |
|---|
StringIndexOutOfBoundsException()
构造一个没有详细消息的
StringIndexOutOfBoundsException 。
|
StringIndexOutOfBoundsException(int index)
构造一个新的
StringIndexOutOfBoundsException类,其中包含指示非法索引的参数。
|
StringIndexOutOfBoundsException(String s)
构造具有
StringIndexOutOfBoundsException详细消息的StringIndexOutOfBoundsException。
|
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringpublic StringIndexOutOfBoundsException()
StringIndexOutOfBoundsException 。
public StringIndexOutOfBoundsException(String s)
StringIndexOutOfBoundsException详细消息的StringIndexOutOfBoundsException。
s - 详细信息。
public StringIndexOutOfBoundsException(int index)
StringIndexOutOfBoundsException类,其中包含指示非法索引的参数。
index - the illegal index.
Submit a bug or feature
For further API reference and developer documentation, see Java SE Documentation. That documentation contains more detailed, developer-targeted descriptions, with conceptual overviews, definitions of terms, workarounds, and working code examples.
Copyright © 1993, 2014, Oracle and/or its affiliates. All rights reserved.