October 2018
Intermediate to advanced
982 pages
23h 29m
English
To override a function on Kotlin, it is necessary to put an override keyword on the function declaration, and the base function needs to have the open keyword as well.
Let's look at an example:
open class Greetings { open fun greeting() {}} class SuperGreeting() : Greetings() { override fun greeting() { // my super greeting }}
This way is more explicit than Java, it increases the legibility of the code as well.
Read now
Unlock full access