Kotlin doesn't have a ternary operator, use `if(.....
# getting-started
k
Kotlin doesn't have a ternary operator, use
if(...) then ... else ...
.
😞 2
k
Thanks
k
But in this case both ternary and this are ridiculous, you already have a boolean.
... ? true : false
doesn't do anything in Java either.
k
That’s not the point, i’m trying to use ? : operator in kotlin, of course, i don’t put true/false 😄
k
Ah okay, just making sure 😉.
👍 1
See https://kotlinlang.org/docs/reference/control-flow.html, both
if
and
when
can be used as expressions.
k
I will check that, many thanks