是否有投在C#中的关键字象Java?
问题描述:
可能重复:结果
的如何使用Java风格抛出关键字在C#?
我在那里发生异常
说,例如
i have a function where an exception occurs say for example
private void functionName() throws Exception
{
// some code that might throw an exception
}
谢谢!
答
没有,因为没有在C#中的checked异常
No, because there are no checked exceptions in C#
如果你想文档时所抛出的异常,可以使用标准的XML文档
If you are trying to document exceptions that are thrown, use the standard xml documentation
/// <exception cref="InvalidOperationException">Why it's thrown.</exception>