Search⌘ K
AI Features

Introduction to Class Hierarchies and Inheritance

Explore Kotlin’s approach to class hierarchies and inheritance, including interfaces, abstract classes, and sealed classes. Understand how Kotlin supports design by contract and class reuse to build complex and safe applications. Learn how nested, inner, and enum classes help structure related abstractions effectively.

We'll cover the following...

Classes are more like social creatures than hermits. Classes relate to and build on top of the abstractions defined in other classes. To build complex applications, it should be easy to create hierarchies of abstractions. Kotlin does that well—you can create interfaces, define nested and inner classes, and also use inheritance. ...