What does declaring a class as
data class automatically generate?- aA private constructor that prevents instantiation outside the file.
- bA default no-argument constructor only.
- c
equals(),hashCode(),toString(), andcopy().✓ - dAutomatic Parcelable serialization with no annotation needed.
Explanation:
data class generates structural equals/hashCode/toString/copy (and componentN functions) from the primary constructor's properties, saving boilerplate.