The Kotlin language provides full support for OOP. We will review powerful structures that allow us to simplify data model definition and operate on it in an easy and flexible way. We'll learn how Kotlin simplifies and improves implementations of many concepts known from Java. We will take a look at different types of class, property, initializer block, and constructor. We will learn about operator overloading and interface default implementations.
In this chapter, we will cover the following topics:
- Class declaration
- Properties
- Property access syntax
- Constructors and initializers blocks
- Constructors
- Inheritance
- Interfaces
- Data classes
- Destructive declarations
- Operator overloading
- Object declaration
- Object expression
- Companion objects
- Enum classes
- Sealed classes
- Nested classes