Is Java the only language that has Checked Exceptions? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 12

Is Java the only language that has Checked Exceptions?

I'm not asking about the definition of checked and unchecked exceptions, so please don't post a link to such a source. I'm just asking if you know a language other than Java which checks for the handling of exceptions by the programmer at compile time.

25th Mar 2019, 6:03 AM
Sonic
Sonic - avatar
8 Answers
+ 8
Schindlabua,Vigil deletes source code at run time? That's the first time I've heard of that!
25th Mar 2019, 7:26 AM
Sonic
Sonic - avatar
+ 8
That's OK ⚡Prometheus ⚡ . And congratulations on halfway to level 18!
26th Mar 2019, 1:02 AM
Sonic
Sonic - avatar
+ 7
https://www.sololearn.com/discuss/1208853/?ref=app Not for you Sonic, I had to put this here in case anyone seeing this question does not get what you mean.
26th Mar 2019, 12:59 AM
👑 Prometheus 🇸🇬
👑 Prometheus 🇸🇬 - avatar
+ 5
Sonic Yeah it's a joke language but I thought it was pretty funny. :D
25th Mar 2019, 7:27 AM
Schindlabua
Schindlabua - avatar
+ 3
Nice question! I'm not aware of any others. Checked Exceptions are pretty unpopular even among Java folk, so if there aren't any now, there probably won't be in the future. In C++ there is `noexcept` which does some compile time checks to make sure a function does not throw an exception, I guess that's similar but also opposite. And then theres languages without proper exceptions but that's also not really the same. Haskell typically communicates error with the `Either` and `Maybe` types which pass through the typechecker like everything else. (There is Control.Exception but I digress). And for fun I'll mention Vigil, which will delete your source code when it finds an unhandled exception, to punish you. All runtime though and not really checked at all. I guess you have a compile-time contract with the runtime to be vigilant.
25th Mar 2019, 7:15 AM
Schindlabua
Schindlabua - avatar
+ 2
Yes, the concept of checked exceptions as such does only exist in Java.
25th Mar 2019, 6:56 AM
Bronco
Bronco - avatar
+ 2
@Sonic: yes, Vigil is a very "safe" esoteric programming language that does try to not allow unhandled exceptions ;-) https://github.com/munificent/vigil
25th Mar 2019, 7:29 AM
Bronco
Bronco - avatar
+ 1
In Python programming exception handling is like a fun and joyable 😀
25th Mar 2019, 1:38 PM
Tahir Iqbal
Tahir Iqbal - avatar