English
Summary
Conclusions
Special class forms help express data structure and valid states. A data class supports value operations, enum describes constants, and sealed describes alternatives with different data. Object and companion define access and creation, while a value class distinguishes meaningful identifiers.
Self-check questions
- Which properties participate in data class generation?
- Why is copy not a deep copy?
- How does constructor order relate to destructuring?
- Why is ordinal unsuitable for a stable code?
- When is enum insufficient and a sealed type needed?
- What are the limits of a sealed hierarchy's closed nature?
- Why is an exhaustive when useful when extending a model?
- Does thread-safe object initialization make all its methods safe?
- How does a companion differ from an instance of the class?
- How does a value class differ from a typealias?