SnowmanX95
01/25/2018, 7:33 PMopen class Foo(val name: String = "John", val age: Int = 0)
class DerivedFoo(val title: String = "Guru", name: String, age: Int) : Foo(name, age)
How do I make sure the constructor of DerivedFoo can use the default values from Foo for name and age? Something like this:
class DerivedFoo(val title: String = "Guru", name: String = super.name, age: Int = super.age) : Foo(name, age)
Is there a simple way (besides writing 3 variations of the constructor)?