IndexOutOfBoundsException
Stay organized with collections
Save and categorize content based on your preferences.
Page Summary
IndexOutOfBoundsException signals that an index is out of bounds, like when accessing an array, string, or vector with an invalid index.
It's a subclass of RuntimeException and has two direct subclasses, ArrayIndexOutOfBoundsException and StringIndexOutOfBoundsException, for more specific scenarios.
The exception can be constructed with or without a detailed message, providing context for the error.
Returns an array containing all of the exceptions that were
suppressed, typically by the try-with-resources
statement, in order to deliver this exception.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-07-10 UTC."],[],["`IndexOutOfBoundsException` signals an out-of-range index, typically in arrays or strings. It extends `RuntimeException` and has subclasses like `ArrayIndexOutOfBoundsException` and `StringIndexOutOfBoundsException`. It can be instantiated with or without a detailed message. Key actions include inheriting methods from `Throwable` and `Object`, such as getting the cause, stack trace, localized message, adding suppressed exceptions, printing stack traces, and basic object operations like cloning and notification.\n"]]