rrader
09/08/2017, 2:30 PMclass Product(val title: String, val description: String)
class Electronics(title: String, description: String, val memory: Long) : Product(title, description)
class Clothing(title: String, description: String, val size: Long) : Product(title, description)
it will more nice to do like
class Clothing(embed product: Product, val size: Long)
and not to duplicate everytime title: String, description: String
in child constructorguenther
09/11/2017, 6:20 AMclass Product(val title: String, val description: String) {
constructor(val title: String, val description: String, val other: String) : this(title, description) {
}
}
Or do you think about just to support the primary constructor (what is totally fine I guess)