Is there a good way to deal with data classes and ...
# getting-started
w
Is there a good way to deal with data classes and inheritance? Is the best way to do this to make the Parent's
a
open and the Childrens'
a
override? I'd really just like for the
a
of the children not to be a
val
.
Copy code
sealed class Parent(val a: Int)
data class Child1(val a: Int, val b: Int) : Parent(a)
data class Child2(val a: Int, val c: Int): Parent(a)
a
what should
a
be in the child-classes?