1.

Which of these exceptions will occur if we try to access the index of an array beyond its length?(a) ArithmeticException(b) ArrayException(c) ArrayArguementException(d) IndexOutOfRangeExceptionThis question was addressed to me in final exam.The question is from Exceptions of Type Finally and Built in Exceptions in chapter Indexers and Exception Handling of C#

Answer»

The CORRECT option is (d) IndexOutOfRangeException

Easiest explanation - IndexOutOfRangeException is a built in exception that is CAUSED when we try to access an index LOCATION which is beyond the length of an ARRAY.



Discussion

No Comment Found

Related InterviewSolutions