Professional Documents
Culture Documents
Print (18) J Knonoiuj9hiobiob
Print (18) J Knonoiuj9hiobiob
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
4. ca ch block
i h In alidC a
E ce p ion
www.niitstudent.com/india/Online_OLT/Forms/Results.aspx?S
1/1