Question
Unhandled Exception: System.lndexOutOfRangeException:
Index was outside the bounds of the array:
at CompSciBitsConsoleApplication.MyProgram.SetVal(Int32 index, Int32 val) in
D:\Sample\CompSciBitsConsoleApplication\MyProgram.cs:line 26
at CompSciBitsConsoleApplication.MyProgram.Main(String[] args) in
D:\Sample\CompSciBitsConsoleApplication\MyProgram.cs:line 20
1. The CLR failed to handle the exception.
2. The class MyProgram belongs to the namespace MyProgram.
3. The function SetVal() was called from Main() in line number 20.
4. The exception occurred in line number 26 in the function SetVal()
5. The runtime exception occurred in the project CompSciBitsConsoleApplication.
a.
1 only
b.
1 and 2 only
c.
3, 4 and 5 only
d.
All of the above
Posted under C# programming
Engage with the Community - Add Your Comment
Confused About the Answer? Ask for Details Here.
Know the Explanation? Add it Here.
Q. Which of the following statements are correct about the exception reported below? Unhandled Exception: System.lndexOutOfRangeException: Index was outside the bounds of the...
Similar Questions
Discover Related MCQs
Q. Which of the following is the Object Oriented way of handling run-time errors?
View solution
Q. Exceptions can be thrown even from a constructor, whereas error codes cannot be returned from a constructor.
View solution
Q. All code inside finally block is guaranteed to execute irrespective of whether an exception occurs in the protected block or not.
View solution
Q. Which of the following is NOT an Exception?
View solution
Q. It is compulsory for all classes whose objects can be thrown with throw statement to be derived from System.Exception class.
View solution
Q. Which of the following statements is true about an enum used in C#.NET?
View solution
Q. An enum that is declared inside a class, struct, namespace or interface is treated as public.
View solution
Q. An enum can be declared inside a class, struct, namespace or interface.
View solution
Q. Which of the following CANNOT be used as an underlying datatype for an enum in C#.NET?
View solution
Q. Which of the following statements is correct about an enum used in C#.NET?
View solution
Q. Choose the correct statement among the followings?
View solution
Q. Choose the keyword which declares the indexer?
View solution
Q. Choose the operator/operators which is/are not used to access the [] operator in indexers?
View solution
Q. Choose the correct statement among the following?
View solution
Q. Which among the following are the advantages of using indexers?
View solution
Q. Choose the correct statement about properties describing the indexers?
View solution
Q. Choose the correct alternative that utilizes the indexed property such that a group named class has indexed property which stores or retrieves value to/from an array of 5 numbers?
View solution
Q. Choose the correct option among the following indexers which correctly allows to index in same way as an array?
View solution
Q. Choose the wrong statement about the properties used in C#.NET?
View solution
Q. Choose the statements which makes use of essential properties rather than making data member public in C#.NET?
View solution
Suggested Topics
Are you eager to expand your knowledge beyond C# programming? We've curated a selection of related categories that you might find intriguing.
Click on the categories below to discover a wealth of MCQs and enrich your understanding of Computer Science. Happy exploring!