Difference between catch(Exception error) and catch

 Posted by Bharathi Cherukuri on 1/31/2012 | Category: C# Interview questions | Views: 2712 | Points: 40
Answer:

The code below explains the difference between catch(Exception error) and catch

try
{
//Code that might generate error
}

catch(Exception error)
{
//Catches all Cls-complaint exceptions
}

catch
{
//Catches all other exception including the Non-Cls complaint exceptions
}


Asked In: Many Interviews | Alert Moderator 

Comments or Responses

Posted by: Akiii on: 5/23/2012 | Points: 10
Good question ....But which one should be used ideally ?



Thanks and Regards
Akiii

Login to post response