Класс ArrayIndexOutOfBoundsException
- java.lang.Object
-
- java.lang.Throwable
-
- java.lang.Exception
-
- java.lang.RuntimeException
-
- java.lang.IndexOutOfBoundsException
-
- java.lang.ArrayIndexOutOfBoundsException
- Все реализованные интерфейсы:
Serializable
public class ArrayIndexOutOfBoundsException extends IndexOutOfBoundsException
Бросается для указания того, что к массиву обращаются с незаконным индексом. Индекс либо отрицательный, либо больше или равен размеру массива.
- C момента:
- 1.0
- См. также:
- Сериализованная форма
Конструкторы
| Конструктор | Описание |
|---|---|
ArrayIndexOutOfBoundsException() | Создаёт |
ArrayIndexOutOfBoundsException(int index) | Создаёт новый класс |
ArrayIndexOutOfBoundsException(String s) | Создаёт класс |
Методы
Методы, объявленные в классе java.lang.Throwable
addSuppressed, fillInStackTrace, getCause, getLocalizedMessage, getMessage, getStackTrace, getSuppressed, initCause, printStackTrace, printStackTrace, printStackTrace, setStackTrace, toStringМетоды, объявленные в классе java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitКонструкторы
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException()
Создаёт ArrayIndexOutOfBoundsException, не имеющий сообщения об ошибке.
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(String s)
Создаёт класс ArrayIndexOutOfBoundsException, содержащий указанное сообщение об ошибке.
- Параметры:
-
s- сообщение об ошибке.
ArrayIndexOutOfBoundsException
public ArrayIndexOutOfBoundsException(int index)
Создаёт новый класс ArrayIndexOutOfBoundsException, содержащий аргумент, указывающий на незаконный индекс.
Индекс включён в сообщение об ошибке этого исключения. Точный формат представления сообщения об ошибке не определён.
- Параметры:
-
index- незаконный индекс.
© 1993, 2020, Oracle and/or its affiliates. All rights reserved.
Documentation extracted from Debian's OpenJDK Development Kit package.
Licensed under the GNU General Public License, version 2, with the Classpath Exception.
Various third party code in OpenJDK is licensed under different licenses (see Debian package).
Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
https://docs.oracle.com/en/java/javase/11/docs/api/java.base/java/lang/ArrayIndexOutOfBoundsException.html