fork download
  1. using System;
  2.  
  3. namespace Articulos.Cap04
  4. {
  5. public sealed class OrdenCatch
  6. {
  7. public static void Main()
  8. {
  9. object o = null;
  10.  
  11. try
  12. {
  13. int i = (int) o;
  14. }
  15. catch (Exception e)
  16. {
  17. //...
  18. }
  19. catch (InvalidCastException e)
  20. {
  21. //...
  22. }
  23. }
  24. }
  25. }
Compilation error #stdin compilation error #stdout 0s 0KB
stdin
Standard input is empty
compilation info
prog.cs(19,25): error CS0160: A previous catch clause already catches all exceptions of this or a super type `System.Exception'
Compilation failed: 1 error(s), 0 warnings
stdout
Standard output is empty