- Data classes have the same functionality as classes, but they come automatically with additional member functions
- Some useful pre-defined member functions,
toString()
equals() or ==
copy()
data class User (
val name: String,
val id: Int
)
toString()
equals() or ==
copy()
data class User (
val name: String,
val id: Int
)