I started to learn Kotlin and I can't understand how to handle exceptions. I know there's no checked ones, but anyway, what should I do if my method throws one? For example:
fun test(a: Int, b: Int) : Int {
return a / b
}
If I divide by zero, I will have ArithmeticException. So how should I handle such things?
try-catchworks pretty much the same way as it does in Java. You can see it in the docs about exceptions here.