Answers for "Kotlin ternary"

7

Kotlin ternary

if (a) b else c

println(if (true) "yes" else "no") // "yes"
println(if (false) "yes" else "no") // "no"
Posted by: Guest on May-10-2020
0

kotlin else if

if (a > b) {
  // if
} else if (a == b) {
  // else if
} else {
  // else
}
Posted by: Guest on November-17-2020

Browse Popular Code Answers by Language