3 ms·
> Ok, sorry it's been about 20 years since I last javad and you didn't have to declare exceptions in your function signatures. You're probably remembering Runt
by Terr_ 5mo ago
> Ok, sorry it's been about 20 years since I last javad and you didn't have to declare exceptions in your function signatures.
You're probably remembering RuntimeExceptions, which are a subgroup [0] that are exempt from "checking" by the compiler, which means it does not require method signatures to declare "I might emit this."
[0] https://docs.oracle.com/en/java/javase/26/docs/api/java.base/java/lang/Exception.html https://docs.oracle.com/en/java/javase/26/docs/api/java.base...
- vips7L 5mo agoYou can declare your runtime exceptions too. The compiler won’t enforce you to catch them though. void fn() throws IllegalStateException