3 ms·
Very similar in C#: var dog = new Animal(){ name="dog", numberOfLegs=4 }; I use it all the time.
by jimmaswell 9y ago
Very similar in C#:
var dog = new Animal(){ name="dog", numberOfLegs=4 };
I use it all the time.
- bunderbunder 9y agoThe big difference there would be, in the C# example you've still got to write a bunch more boilerplate for Equals(), GetHashCode() and ToString(). Kotlin's data classes give you those three for free.