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.

Слідкуй за CodeGalaxy

Мобільний додаток Beta

Get it on Google Play
Зворотній Зв’язок
Продовжуйте вивчати
тести з C#
Cosmo
Зареєструйся Зараз
або Підпишись на майбутні тести