What is the difference between a checked and an unchecked exception?
Sigiloso
In Java, a checked exception is an Exception-derived type that you declare can be thrown, and the caller must either catch them or propagate via "throws". The Java compiler and certain tools analyze that checked exception handling has been met. Unchecked exceptions are RuntimeException-derived and have no such requirements. However, many devs just put "throws Exception", or in the calling stack have "catch { }" to neutralize any code analysis that tries to find any callers who don't properly handle all throwable exception types. This defeats the whole purpose of detailing checked exceptions. In C# there is no formal distinction, per guys like Anders Hejlsberg's reasons related to versioning and scalability. I happen to agree.