Exception handling is the technic to prevent program from terminating abnormally.
If we don't handle the exception then the subsequent code won't be executed but if we handle/catch it then we can allow the subsequent code to be continue
Suspicious code will be written in try{}
Finally {} will be executed in any case. always.
With try we can chain with multiple catch blocks. executed in sequence.
try {} can be pair with catch{} or finally{}
Throw
We can throw the exception. In any customise requirement we can throw an exception
if we can not catch it then the program terminate abnormally and the below error log will appear.
Note: Kotlin does not have checked exceptions