I faced a question on Custom Exceptions in an Interview. As below there are four multiple catches which catch each custom exception. Interviewer asked me to write a pseudo code for catch blocks how i can handle all four custom exceptions.
I answered as
try
{ try
{
try { }
catch (DEx dEx) { Console.WriteLine(dEx.Message); }
}
catch (BEx bEx) { Console.WriteLine(bEx.Message); }
catch (CEx cEx) { Console.WriteLine(cEx.Message); }
}
catch (AEx aEx) { Console.WriteLine(aEx.Message); }
Is it correct or wrong?