You are on page 1of 1

11/9/11

Test Engine

Question Te t
Consider the follow ing code snippet:
void show ()
{
try
{
FileStream fs = new FileStream("orders.txt", FileMode.Open, FileAccess.Read);
StreamReader sr = new StreamReader(fs);
String str = sr.ReadLine();
Console.WriteLine(str);
Console.Read();
catch (IOException e)
{
Console.WriteLine(e.Message);
Console.Read();
catch (NullReferenceException e1)
{
Console.WriteLine(e1.Message);
catch (InvalidCastException e2)
{
Console.WriteLine(e2.Message);
catch (ArgumentNullException e3)
{
Console.WriteLine(e3.Message);

The preceding code throw s an exception that displays the message 'Could not find file', w hen it is executed. Identify, w hich of the catch
blocks has handled the exception.
Options
1. ca ch block

i h IO E ce p ion

2. ca ch block

i h A g m e n N llE ce p ion

3. ca ch block

i h N llR e fe e nce E ce p ion

4. ca ch block

i h In alidC a

E ce p ion

Correct Ans er: -> 1


Your Ans er: -> 1
Feedback: -> NONE
Close

www.niitstudent.com/india/Online_OLT/Forms/Results.aspx?S

1/1

You might also like