Basics the open keyword
suggest changeIn Kotlin, classes are final by default which means they cannot be inherited from.
To allow inheritance on a class, use the open
keyword.
open class Thing {
// I can now be extended!
}
Note: abstract classes, sealed classes and interfaces will be open by default.
Found a mistake? Have a question or improvement idea?
Let me know.
Table Of Contents