Exception Handling

Checked Exception

English

Overview

A category of exception where handling it is mandatory at compile time.

Details

A category of exception where the compiler forces you to write handling code (a try-catch or throws declaration), a mechanism characteristic of Java. In Java, it must be declared in a method's signature with a throws clause, and the caller is forced to either catch it or re-declare it -- otherwise the code won't compile. This mandatory handling has drawn criticism for being cumbersome, and languages like C# and Kotlin deliberately don't have an equivalent mechanism.

More Programming terms