January 2022
Intermediate to advanced
356 pages
6h 9m
English
What's the difference between var and val in Kotlin?
The val keyword declares an immutable value that cannot be modified once assigned. The var keyword declares a mutable variable that can be assigned multiple times.
How do you extend a class in Kotlin?
To extend a class, you can specify its name and constructor after a semicolon. If it's a regular class, it must be declared open for your code to be able to extend it.
How do you add functionality to a final class?
To add functionality to a class that we cannot inherit from, we can use an extension function. The extension function will have access only to the class itself and to its public ...
Read now
Unlock full access