Stay organized with collections
Save and categorize content based on your preferences.
ArrayIndexOutOfBoundsException
open class ArrayIndexOutOfBoundsException : IndexOutOfBoundsException
Thrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.
Summary
Public constructors |
Constructs an ArrayIndexOutOfBoundsException with no detail message.
|
Constructs a new ArrayIndexOutOfBoundsException class with an argument indicating the illegal index.
|
Constructs an ArrayIndexOutOfBoundsException class with the specified detail message.
|
Public constructors
ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsException()
Constructs an ArrayIndexOutOfBoundsException
with no detail message.
ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsException(index: Int)
Constructs a new ArrayIndexOutOfBoundsException
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. |
ArrayIndexOutOfBoundsException
ArrayIndexOutOfBoundsException(s: String!)
Constructs an ArrayIndexOutOfBoundsException
class with the specified detail message.
Parameters |
s |
String!: the detail message. |
Content and code samples on this page are subject to the licenses described in the Content License. Java and OpenJDK are trademarks or registered trademarks of Oracle and/or its affiliates.
Last updated 2025-02-10 UTC.
[null,null,["Last updated 2025-02-10 UTC."],[],[],null,["# ArrayIndexOutOfBoundsException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels)\n\nArrayIndexOutOfBoundsException\n==============================\n\n```\nopen class ArrayIndexOutOfBoundsException : IndexOutOfBoundsException\n```\n\n|---|---|---|---|---|-----------------------------------------------|\n| [kotlin.Any](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-any/index.html) ||||||\n| ↳ | [kotlin.Throwable](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-throwable/index.html) |||||\n| | ↳ | [java.lang.Exception](/reference/kotlin/java/lang/Exception) ||||\n| | | ↳ | [java.lang.RuntimeException](/reference/kotlin/java/lang/RuntimeException) |||\n| | | | ↳ | [java.lang.IndexOutOfBoundsException](/reference/kotlin/java/lang/IndexOutOfBoundsException) ||\n| | | | | ↳ | [java.lang.ArrayIndexOutOfBoundsException](#) |\n\nThrown to indicate that an array has been accessed with an illegal index. The index is either negative or greater than or equal to the size of the array.\n\nSummary\n-------\n\n| Public constructors ||\n|-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|---|\n| [ArrayIndexOutOfBoundsException](#ArrayIndexOutOfBoundsException())`()` Constructs an `ArrayIndexOutOfBoundsException` with no detail message. |\n| [ArrayIndexOutOfBoundsException](#ArrayIndexOutOfBoundsException(kotlin.Int))`(`index:` `[Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html)`)` Constructs a new `ArrayIndexOutOfBoundsException` class with an argument indicating the illegal index. |\n| [ArrayIndexOutOfBoundsException](#ArrayIndexOutOfBoundsException(kotlin.String))`(`s:` `[String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!`)` Constructs an `ArrayIndexOutOfBoundsException` class with the specified detail message. |\n\nPublic constructors\n-------------------\n\n### ArrayIndexOutOfBoundsException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nArrayIndexOutOfBoundsException()\n```\n\nConstructs an `ArrayIndexOutOfBoundsException` with no detail message. \n\n### ArrayIndexOutOfBoundsException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nArrayIndexOutOfBoundsException(index: Int)\n```\n\nConstructs a new `ArrayIndexOutOfBoundsException` class with an argument indicating the illegal index.\n\nThe index is included in this exception's detail message. The exact presentation format of the detail message is unspecified.\n\n| Parameters ||\n|---------|------------------------------------------------------------------------------------------------|\n| `index` | [Int](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-int/index.html): the illegal index. |\n\n### ArrayIndexOutOfBoundsException\n\nAdded in [API level 1](https://developer.android.com/guide/topics/manifest/uses-sdk-element.html#ApiLevels) \n\n```\nArrayIndexOutOfBoundsException(s: String!)\n```\n\nConstructs an `ArrayIndexOutOfBoundsException` class with the specified detail message.\n\n| Parameters ||\n|-----|--------------------------------------------------------------------------------------------------------|\n| `s` | [String](https://kotlinlang.org/api/latest/jvm/stdlib/kotlin/-string/index.html)!: the detail message. |"]]