February 2018
Intermediate to advanced
356 pages
9h 10m
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