January 2018
Intermediate to advanced
434 pages
14h 1m
English
In Kotlin, we can have functions as expressions by creating lambdas. Lambdas are function literals—that is, they are not declared as they are expressions and can be passed as parameters. However, we cannot declare return types in lambdas. Although the return type is inferred automatically by Kotlin compiler in most cases, for cases where it cannot be inferred on its own or it needs to be declared explicitly, we use anonymous functions. In this recipe, we will see how to use anonymous functions.
Read now
Unlock full access