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#).
精彩评论