Pergunta de entrevista da empresa Simform

If else condition using let in kotlin

Resposta da entrevista

Sigiloso

29 de dez. de 2020

fun main() { var someValue : String? = null someValue = "SOF" someValue?.let {safeSomeValue-> //This code block will run only if someValue is not null println("then") }?:run { //This code block will run only when if someValue is null, like else condition. println("else") } }