If I run the following code snippet in .NET framework 4.0, what will be the output?

int i = 0;
int j = 15 / i;
Console.WriteLine("The value of J is {0}",j);
catch (Exception exx)
Console.WriteLine("Base class exception occurs");
catch (DivideByZeroException exx)
Console.WriteLine("Divide by Zero Exception occurs");

 Posted by Nagasundar_Tn on 11/20/2012 | Category: C# Interview questions | Views: 2986 | Points: 40
Select from following answers:
  1. Base class exception occurs
  2. Compiler Error : A previous catch clause already catches all exceptions of this or of a super type ('System.Exception')
  3. Divide by Zero Exception occurs
  4. No output.
  5. All Above

Show Correct Answer

Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Login to post response