No checked exceptions
Kotlin only knows runtime exceptions, a
throws declaration is neither necessary nor possible.
finally blocks are available - just never required.
While Java differentiates between runtime exceptions and checked exceptions, in Kotlin there are only the former.
The difference to runtime exceptions is that any function that can potentially raise a checked exception must declare it with
In addition, the client is forced to encapsulate the call in a
try/catch block or to declare the exception’s passing on with
This is not necessary for runtime exceptions.
Therefore, in Kotlin the declaration of possibly raised exceptions with
throws is not necessary (and not even possible - the corresponding keyword is just missing).
Nevertheless, one can use
try/catch - just like in Java - to handle possible exceptions.