Try/catch can be used as expressions:
val ret:Int? try {
Integer.ParseInt(some string)
} catch (e: NumberFormatException ) {
null
}
Kotlin supports the Java exception hierarchy but exceptions are unchecked.
Try/catch can be used as expressions:
val ret:Int? try {
Integer.ParseInt(some string)
} catch (e: NumberFormatException ) {
null
}
Kotlin supports the Java exception hierarchy but exceptions are unchecked.