August 2017
Intermediate to advanced
440 pages
10h
English
Under the hood, function types are just a syntactic sugar for generic interfaces. Let's look at some examples:
All of these interfaces have only one method, invoke, which is an operator. It allows an object to be used like a function:
val a: (Int) -> Unit = //...
a(10) // 1
a.invoke(10) // 1
Read now
Unlock full access