This is the last chapter of the object-oriented programming series, in which we are going to learn about some more advanced concepts. Kotlin provides a neat, convenient, and concise way of implementing these concepts, unlike traditional programming languages, which require us to write lengthy and complex code.
In this chapter, we will discuss sealed classes and enumeration. We will also try to understand what a singleton is and how to use companion objects instead of static functions. After that, we will discuss the important topics of composition and aggregation, and we will end by exploring class properties and delegation to see how Kotlin helps to improve application development.
The following topics will be covered in this chapter:
- Sealed classes and enumeration
- Object and companion objects
- Composition and nested classes
- Properties
- Delegate properties...