having a base class and Child derived from it:
open class Base(var data: String) {
init {
doInit()
}
open protected fun doInit() {
data += " in Base doInit()"
}
}
class Child(data: String): Base(data) {
init {
doInit()
}
override fun doInit() {
data += super.doInit() + " in Child doInit()"
}
}
val obj = Child("child")
in Child("child"), the Base's init{} is called. which doInit() the Base's init{} is supposed to call, from the Base's one or the Child's one?