public class TestException
{
public static void Main()
{
int val = 0;
int result = 0;
try
{
result = 100/val;
}
catch(Exception ex)
{
Console.WriteLine("Unknown error occured");
}
catch(DivideByZeroException ex1)
{
Console.WriteLine("Division by zero results in error" );
}
finally
{
Console.WriteLine("Finally Block executed");
}
Console.WriteLine("Result :" + result);
}
}
What will be the output?
Compile error - "A previous catch clause already catches all exceptions of this or of a super type ('System.Exception')"
More specialized catch block should come before a generalized one in a Try Catch block