mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-12 00:21:32 +00:00
13 lines
189 B
Kotlin
Vendored
13 lines
189 B
Kotlin
Vendored
// OPTION: 1
|
|
fun foo(n: Int): Int {
|
|
return try {
|
|
n / 0
|
|
} <caret>catch (e: ArithmeticException) {
|
|
-1
|
|
} catch (e: Exception) {
|
|
-2
|
|
} finally {
|
|
|
|
}
|
|
}
|