Answers for "kotlin crossinline"

0

kotlin crossinline

fun doSomething() {
    print("doSomething start")
    doSomethingElse {
        print("doSomethingElse")
        return // notice this return
    }
    print("doSomething end")
}

inline fun doSomethingElse(abc: () -> Unit) {
    // I can take function
    // do something else here
    // execute the function
    abc()
}
Posted by: Guest on July-12-2021

Browse Popular Code Answers by Language