In addition to classes, abstract classes, and data classes, Kotlin provides several other special types of class that can be utilized in different situations. These special classes can help us to improve explicit type safety in our code, efficiently represent sealed class hierarchies, and even simplify the singleton design pattern. In this section, we will explore the following:
- Enums
- Sealed classes
- Object classes
We will examine each of these class types and how they can improve our Kotlin code.