fabricio
01/20/2018, 11:25 AMwhen (obj) {
null -> println("is null")
else -> println("is not null")
}
I couldn't figure out how to check for not null instead.. is that possible? like !null ->
😄kingsley
01/20/2018, 11:29 AMwhen {
obj == null -> println("is null")
obj != null -> println("is not null")
}
Otherwise, it might be better to simply use if (obj != null)
or perhaps, the null coalescing operator ?.
, depending on your use-casefabricio
01/20/2018, 11:29 AM