Steph Bassos

Steph Bassos

  • NA
  • 17
  • 15.6k

Ordered Catch

Aug 14 2013 11:18 PM
Can't get this to run to show an ordered catch. What is wrong?


{
class Program
{
static void Main(string[] args)
{
try
{
int x = 0;
int y = 5 / x;
}
catch (ArithmeticException ex)
{ //derived
MessageBox.Show(ex.Message);
}
catch (Exception ex)
{ //base
MessageBox.Show(ex.Message);
}
}
}
}

Answers (1)