is there any way to inherit super class default co...
# announcements
a
is there any way to inherit super class default constructor values?
Copy code
open class A(val a: String, val b: String = "hello")

class B(a: String, b: String, c: String) : A(a, b) {

}
in this scenario would it be possible to have
b
arg in class
B
have default value
"hello"
while being DRY?
k
There's no nice way to do that I'm afraid.
c
companion object
comes to mind, but yeah, nothing elegant as in inheritance, you still have to specify them.
k
What would you do with a companion object?
a
@karelpeeters store the default values and then reference them
c
👆