模块 java.base
 java.lang

类 StringIndexOutOfBoundsException

所有已实现的接口:
Serializable

public class StringIndexOutOfBoundsException extends IndexOutOfBoundsException
String 方法抛出以指示索引为负数或大于字符串的大小。对于一些方法比如charAt 方法,当索引等于字符串大小时也会抛出这个异常。
自从:
1.0
参见:
  • 构造方法详细信息

    • StringIndexOutOfBoundsException

      public StringIndexOutOfBoundsException()
      构造一个没有详细消息的StringIndexOutOfBoundsException
    • StringIndexOutOfBoundsException

      public StringIndexOutOfBoundsException(String  s)
      用指定的详细信息构造一个 StringIndexOutOfBoundsException
      参数:
      s - 详细消息。
    • StringIndexOutOfBoundsException

      public StringIndexOutOfBoundsException(int index)
      使用指示非法索引的参数构造一个新的 StringIndexOutOfBoundsException 类。

      该索引包含在此异常的详细消息中。详细消息的确切表示格式未指定。

      参数:
      index - 非法索引。