C# explicitly defining what exceptions are thrown

前端 未结 6 573
礼貌的吻别
礼貌的吻别 2020-12-03 09:55

In Java, you explicitly define what exceptions are thrown using the \"throws\" keyword. That way, anyone calling your method knows what to catch.

Is there something

6条回答
  •  时光取名叫无心
    2020-12-03 10:33

    C# doesn't support checked exceptions. The language designers consider checked exceptions in the way java uses them a bad idea.

    Some workarounds

提交回复
热议问题