Kotlin - Control Flow as Expressions
What will be the output of this Kotlin code?
fun test(obj: Any) {
when (obj) {
is String -> println(obj.length)
is Int -> println(obj + 1)
else -> println("Unknown")
}
}
test("Hello")
test(5)
test(3.14)