This code will compile successfully (as part of a method):
 
try 
{ 
     Console.WriteLine("TRY"); 
     throw new Exception("EXCEPTION"); 
} 
catch (Exception) 
{ 
      Console.WriteLine("CATCH"); 
}
 
Explanation
It is not necessary to indicate the identifier of exception in the catch block.

Follow CodeGalaxy

Mobile Beta

Get it on Google Play
Send Feedback
Cosmo
Sign Up Now
or Subscribe for future quizzes