mathew murphy
08/07/2019, 8:32 PMabstract class AbstractClass (
val a : String? = null,
val b : String? = null,
val c : String? = null,
val d : String? = null,
val e : String? = null,
val f : String? = null,
val g : String? = null
)
class MyClass (
a, b, c, d, e, f, g,
val h : String? = null,
val i : String? = null
) : AbstractClass(
a, b, c, d, e, f, g
)
Is there any kind of shorthand to avoid having to repeat a,b,c,d,e,f,g twice when defining the class?karelpeeters
08/07/2019, 8:47 PMmathew murphy
08/07/2019, 8:51 PMkarelpeeters
08/07/2019, 8:52 PMkarelpeeters
08/07/2019, 8:52 PMkarelpeeters
08/07/2019, 8:52 PMmathew murphy
08/07/2019, 8:52 PMmathew murphy
08/07/2019, 8:53 PM540grunkspin
08/08/2019, 8:37 AMinterface MyInterface {
val a: String?
val b: String?
}
class Base(
override val a: String? = null,
override val b: String? = null
) : MyInterface
class MyClass(
base: MyInterface,
val c: String? = null
) : MyInterface by base
540grunkspin
08/08/2019, 8:40 AMlc
08/08/2019, 8:49 AMjosephivie
08/08/2019, 4:53 PMJames Richardson
08/09/2019, 7:24 AMJames Richardson
08/09/2019, 7:27 AMJames Richardson
08/09/2019, 7:29 AMmathew murphy
08/27/2019, 9:00 PM