Kotlin data class inheritance

Kotlin data class

A compiler-derived Kotlin data class that holds data (of an object) is the Kotlin Data Class. The data keyword is used to define a Kotlin Data Class. Let’s assume we have to use the Student class that has name, email, and age. The only thing we have to do is write the definition as follows. data class Student(val name: … Read more