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);
}
}
}
}
Loading
Sanjeeb LenkaPosted Aug 14, 2013, 11:59 PM
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace dotnetperl
{
class Program
{
static void Main(string[] args)
{
try
{
int x = 0;
int y = 5 / x;
}
catch (ArithmeticException ex)
{ //derived
Console.WriteLine(ex.Message);
}
catch (Exception ex)
{ //base
Console.WriteLine(ex.Message);
}
Console.ReadLine();
}
}
}