I got the following classes:
class B() : A {
override val p1: String = ...
override fun p2() : String { ... }
}
abstract class A() {
abstract val p1: String
abstract fun p2() : String
fun p3() : String = p1.plus("-").plus(p2())
init {
var p4 = p3()
}
}
I want p4 to be set at declaration. the issue is that when A() constructor is called p1 & p2() are not set yet, so p3() contains nulls. is there a way to solve it? like to run some logic after both constructors are called?