Browse topics
Object Oriented Kotlin
Interfaces
Define and implement interfaces, functional interfaces and properties.
kotlin interfacesInterface Declaration in KotlinAn interface defines a contract that classes can implement. A Kotlin example with source code and sample output.kotlin interfacesImplementing Interfaces in KotlinUse colon syntax to implement one or more interfaces. A Kotlin example with source code and sample output.kotlin interfacesInterface Properties in KotlinInterfaces can declare properties without backing fields. A Kotlin example with source code and sample output.kotlin interfacesFunctional Interfaces in KotlinA functional interface (fun interface) has exactly one abstract method. A Kotlin example with source code and sample output.kotlin interfacesInterface Inheritance in KotlinInterfaces can extend other interfaces. A Kotlin example with source code and sample output.
Related topics
Kotlin Classes Declare classes, properties, constructors and init blocks. Inheritance Open classes, overriding, abstract classes and inheritance rules. 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.