0

Possible Duplicate:
Why are Exceptions not Checked in .NET?

Java makes distinction of "checked exception" and "unchecked exception", does C# have the similiar concepts?

Community
  • 1
  • 1
user496949
  • 83,087
  • 147
  • 309
  • 426

4 Answers4

6

C# does not support checked exceptions. You can read up on why the original design did not include checked exceptions.

Link: The Trouble with Checked Exceptions

Joshua Rodgers
  • 5,317
  • 2
  • 31
  • 29
4

No, there's no such distinction in C#, nor in many other modern languages, even those that run in the JVM (such as Scala).

From the C# Faq, on MSDN: http://blogs.msdn.com/b/csharpfaq/archive/2004/03/12/why-doesn-t-c-have-checked-exceptions.aspx

Bruno Reis
  • 37,201
  • 11
  • 119
  • 156
4

Nope, it does not. No. Thankfully!

kprobst
  • 16,165
  • 5
  • 32
  • 53
2

without the CLR itself supporting checked exceptions, it would be effectively impossible for C# to do so alone.

edgarmtze
  • 24,683
  • 80
  • 235
  • 386
  • The last statement is not true, checked exceptions is a type-system feature, not runtime one. It's a Java feature, not JVM feature. – charlag Feb 07 '20 at 18:53