Inheritance from a class with secondary constructors

Report a typo

Put the lines of code in the right order.

Reorder lines using drag or arrows. Adjust indentation with left buttons
                constructor(name: String, age: Int) : this(name) {
              
                }
              
                open class Person(val name: String) {
              
                var age: Int = 0
              
                }
              
                class Employee(name: String, age: Int, val id: Int) : Person(name, age)
              
                this.age = age
              

Create a free account to access the full topic