1
Answer

Ordered Catch

Steph Bassos

Steph Bassos

11y
798
1
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)
Next Recommended Forum