Put the lines of code in the right order.
Computer scienceProgramming languagesKotlinObject-oriented programmingObject-oriented programming basic
Overriding constructors
Inheritance from a class with secondary constructors
Report a typo
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
By continuing, you agree to the JetBrains Academy Terms of Service as well as Hyperskill Terms of Service and Privacy Policy.