C# explicitly defining what exceptions are thrown

前端 未结 6 581
礼貌的吻别
礼貌的吻别 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:30

    As far as I'm aware there is no throws declaration in C# you can document your method indicating that it throws an exception but no forced error handling.

提交回复
热议问题