ArrayOutOfRangeException CLASS

Exception caused by attempting to use an index out of the allowed range. This can be created by the engine when it is trying to use an index on an array beyond its range. For example, a negative number, or a positive one larger than or equal to the length of the array, will cause this exception. A user may also create this exception pre-emptively as part of the argument check.

Parent Class

All Members


TypeNameSignature
constructorArrayOutOfRangeExceptionpublic ArrayOutOfRangeException(int, int)

Constructors


public ArrayOutOfRangeException(int index, int max)

Create a standard ArrayOutOfRangeException instance. The message for this exception is fixed.

Parameters

  • index The index being accessed.
  • max The max index allowed. The min index is always 0.