开发者

What is the difference between Index Out of Range Exception and Index Outside the Bounds of Array Exception?

开发者 https://www.devze.com 2023-02-09 04:44 出处:网络
Is there any 开发者_如何学编程difference between \"Index was out of range exception\" and \"Index was outside the bounds of the array exception\"?They\'re exactly the same thing.

Is there any 开发者_如何学编程difference between "Index was out of range exception" and "Index was outside the bounds of the array exception"?


They're exactly the same thing.

IndexOutOfRangeException is the name of the exception class that is thrown. Its description is given by Visual Studio as "Index was outside the bounds of the array."

This exception is thrown when an attempt is made to access an element of an array with an index that is outside of the bounds of the array.


Note that the IndexOutOfBoundsException class is not part of C# at all, but rather the Java language (or Microsoft's implementation, J#).

0

精彩评论

暂无评论...
验证码 换一张
取 消