July 2018
Intermediate to advanced
242 pages
8h 6m
English
Apart from extension functions, Kotlin also offers an extension properties feature. For example, we can declare a property for the List<T> class that will hold information about the last element index value:
val <T> List<T>.lastIndex: Int get() = size - 1
Extensions are a widely used pattern across Kotlin standard library classes. They work seamlessly with Java, Kotlin, JavaScript, and native classes defined within the project and in external dependencies as well.
Read now
Unlock full access