Search⌘ K
AI Features

Introduction to Objects and Classes

Explore the fundamentals of object-oriented programming in Kotlin, focusing on creating classes with constructors, properties, and methods. Understand Kotlin's approach to data classes, singletons, and companion objects that reduce boilerplate code. This lesson helps you grasp when to use inheritance versus delegation and how Kotlin simplifies class creation compared to Java making your code clean and expressive.

We'll cover the following...

Kotlin supports the object-oriented paradigm, but with a few twists. The compiler does a healthy dose of code generation to remove boilerplate code and also provides a few special types of classes not available in Java. In this part, you’ll learn the benefits of data classes, sealed classes, companion objects, singletons, and more. From the design point of view, you’ll learn when to use inheritance vs. delegation, both ...