What will be output of below code?

public class MyClass
{
public void Test()
{
try
{
Console.WriteLine("Test");
}
catch (Exception ex)
{
Console.WriteLine("Caught General Exception");
}
catch (IndexOutOfRangeException ex)
{
Console.WriteLine("Caught IO Exception");
}
}
}


Will this code compile?

 Posted by Rajeshatkiit on 12/15/2015 | Category: C# Interview questions | Views: 1200 | Points: 40
Select from following answers:
  1. "Test"
  2. Runtime error
  3. Compile time error
  4. "Test", "Caught General Exception"
  5. All Above

Show Correct Answer


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response

More Interview Questions by Rajeshatkiit