Browse topics
Object Oriented Kotlin
Inheritance
Open classes, overriding, abstract classes and inheritance rules.
kotlin inheritanceInheritance Basics in KotlinInheritance allows a child class to reuse properties and functions of a parent class. A Kotlin example with source code and sample output.kotlin inheritanceopen Classes in KotlinBy default, Kotlin classes cannot be inherited. A Kotlin example with source code and sample output.kotlin inheritanceMethod Overriding in KotlinOverriding replaces parent class function implementation in child class. A Kotlin example with source code and sample output.kotlin inheritanceProperty Overriding in KotlinProperties can also be overridden in subclasses. A Kotlin example with source code and sample output.kotlin inheritanceAbstract Classes in KotlinAbstract classes cannot be instantiated directly. A Kotlin example with source code and sample output.
Related topics
Kotlin Classes Declare classes, properties, constructors and init blocks. Interfaces Define and implement interfaces, functional interfaces and properties. Data Classes Data class declaration, copy, destructuring and equals/hashCode. Objects & Enums Object declarations, companion objects, expressions and enum classes. Sealed Classes Sealed classes, when expressions and restricted type hierarchies.