Abstract, Data and Enum classes. Companion objects.

Abstract classes:

To make abstract classes we use the keyword abstract for the class and its functions.

Data Classes:

As its name suggest, Data classes are classes with the main purpose of keep data. We can use them with the keyword data before the keyword class.

The most important feature of these kind of classes is the function copy. With this function we can copy an object changing just the properties that we want to change.

Enum Classes:

To declare an Enum Class we have to use the keyword enum:

Companion Objects:

Static methods are not defined in Kotlin, like in Java so, if you need to write a static function declare a companion object, and you will be able to call it as static method using only the class name as a qualifier.

blank