Computer scienceProgramming languagesKotlinObject-oriented programmingClass hierarchy

Overriding properties

What is missing

Report a typo

open class Animal {
    val sound: String = "silent"
}

class Cat: Animal() {
    override val sound: String = "meow"
}

While writing the above code, our programmer made a mistake. What keyword is missing in the code?
You can copy the code to your IDE for faster retrieval.

Enter a short text
___

Create a free account to access the full topic