Content deleted Content added
→Data Class: new section |
|||
Line 113:
The section on data classes contains false information. A data class can contain a body, properties not defined in the primary constructor, as well as functions. It is not like a struct in C. The data class adds `hashCode`, `equals`, `toString`, `componentx` functions automatically and I believe that is the main purpose. [[User:0xDeadbeef|0xDeadbeef]] ([[User talk:0xDeadbeef|talk]]) 13:31, 18 October 2020 (UTC)
I didn't mention `componentx` functions, but I did clarify that the key motivation for `data class` is auto-generating `equals`, `hashCode`, and `toString`.
|