mirror of
https://github.com/jlengrand/kotlin.git
synced 2026-05-08 08:31:26 +00:00
26 lines
419 B
Kotlin
Vendored
26 lines
419 B
Kotlin
Vendored
package demo2
|
|
|
|
fun print(o : Any?) {}
|
|
|
|
fun test(i : Int) {
|
|
var monthString : String? = "<empty>"
|
|
when (i) {
|
|
1 -> {
|
|
print(1)
|
|
print(2)
|
|
print(3)
|
|
print(4)
|
|
print(5)
|
|
}
|
|
else -> {
|
|
monthString = "Invalid month"
|
|
}
|
|
}
|
|
print(monthString)
|
|
}
|
|
|
|
fun box() : String {
|
|
for (i in 1..12) test(i)
|
|
return "OK"
|
|
}
|