So I’ve been having an issue with constructor chaining

open class Person( open var age: Int, name: String) {
init {

    println("My name is $name.")
    println("My age is $age")


class MathTeacher( override var age :Int, var name : String): Person(age,name) {

fun teachMaths() {
    println("I teach in primary school $age")


class Footballer(age: Int, name: String): Person(age, name) {
fun playFootball() {
println(“I play for LA Galaxy.”)

fun main(args: Array) {
val t1 = MathTeacher(25, “Jack”)

val f1 = Footballer(29, "Christiano")


So The issue is when I call the maths teacher constructor, it supposedly calls the person class constructor which then initializes the variables
Shouldn’t I be getting null values when I print since my subclass constructor hasn’t run yet

since my subclass constructor hasn’t run yet

Why do you think that the subclass constructor hasn’t run yet?