public class StringIndexOutOfBoundsException
extends IndexOutOfBoundsException
| java.lang.Object | |||||
| java.lang.Throwable | |||||
| java.lang.Exception | |||||
| java.lang.RuntimeException | |||||
| java.lang.IndexOutOfBoundsException | |||||
| java.lang.StringIndexOutOfBoundsException | |||||
通过String抛出方法来指示索引是否定的或大于字符串的大小。 对于某些方法(如charAt方法),当索引等于字符串的大小时,也会引发此异常。
也可以看看:
Public constructors |
|
|---|---|
StringIndexOutOfBoundsException() 构造一个没有详细信息的 |
|
StringIndexOutOfBoundsException(String s) 用指定的详细信息构造一个 |
|
StringIndexOutOfBoundsException(int index) 用一个指示非法索引的参数构造一个新的 |
|
继承方法(Inherited methods) |
|
|---|---|
java.lang.Throwable
|
|
java.lang.Object
|
|
StringIndexOutOfBoundsException ()
构造一个没有详细信息的 StringIndexOutOfBoundsException 。
StringIndexOutOfBoundsException (String s)
用指定的详细信息构造一个 StringIndexOutOfBoundsException 。
| 参数(Parameters) | |
|---|---|
s |
String: the detail message. |
StringIndexOutOfBoundsException (int index)
使用指示非法索引的参数构造一个新的 StringIndexOutOfBoundsException类。
| 参数(Parameters) | |
|---|---|
index |
int: the illegal index. |