1.  Which of the following statements is correct about the C#.NET program given below ?
using System;
namespace IndiabixConsoleApplication
{
class MyProgram
{
static void Main(string[] args)
{
int index = 6;
int val = 44;
int[ ] a = new int[5];
try
{
a[index] = val ;
}
catch(IndexOutOfRangeException e)
{
Console.Write(‘’Index out of bounds ‘’);
}
Console.Write(‘’Remaining program’’);
}
}
}


Value 44 will get assigned to a[6].
It will output: Index out of bounds
It will output: Remaining program
It will output: Index out of bounds Remaining program


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

2.  Choose the correct output for the given set of code :
class program
{
static void main(string[] args)
{
int i = 5;
int v = 40;
int[ ] p = new int[4];
try
{
p[i] = v;
}
catch(IndexOutOfRangeException e)
{
Console.WriteLine(‘’Index out of bounds’’);
}
Console.WriteLine(‘’Remaining program’’);
}
}


value 40 will be assigned to a[5];
The output will be : Index out of bounds Remaining program
The output will be : Remaining program
None of the mentioned


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

3.  Which of these keywords is not a part of exception handling ?


try
finally
thrown
catch


Answer

 Option

Exception handling is managed via 5 keywords – try, catch, throws, throw and finally.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

4.  Which of these keywords must be used to monitor exceptions ?


try
finally
throw
catch


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report

5.  Which of these keywords is used to manually throw an exception ?


try
finally
throw
catch


Answer

 Option

No answer description available for this question.

Workspace

Report
Mail id: Report Error:

Answer Workspace Report