Kotlin ClassesLesson 21Free preview
Kotlin Classes/Objects
This lesson is part of Kotlin · All levels
Summary
This lesson is about defining the Class and the Installation of Objects in Kotlin. Developers will study property declarations, member methods, as well as the specific class types provided by Kotlin such as Data Classes. The data class automatically provides the functions of equals, hashCode, copy, and toString.
Key points
- Class is declared using the keyword 'class'
- Properties can be initialized directly to the class body or to the primary constructor
- 'data class' automatically generates the methods toString(), equals(), hashCode(), and copy()
- Support for visibility access: public (default), private, protected, and internal
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.