BAEL-19 more condition blocks examples

This commit is contained in:
Tomasz Lelek 2017-01-11 18:23:54 +01:00
parent e428638078
commit 79d13928e5
1 changed files with 19 additions and 1 deletions

View File

@ -47,5 +47,23 @@ fun main(args: Array<String>) {
println("Names: $concatOfNames") println("Names: $concatOfNames")
val itemManager = ItemManager("cat_id", "db://connection") val itemManager = ItemManager("cat_id", "db://connection")
print("function result: ${itemManager.isFromSpecificCategory("1")}") val result = "function result: ${itemManager.isFromSpecificCategory("1")}"
println(result)
val number = 2
if (number < 10) {
println("number less that 10")
} else if (number > 10) {
println("number is greater that 10")
}
val name = "John"
when (name) {
"John" -> println("Hi man")
"Alice" -> println("Hi lady")
else -> {
println("Hi")
}
}
} }