So far, all classes were inherited using a primary constructor. If the Student class doesn't have a primary constructor but a secondary constructor instead, the secondary constructor can be preceded by the super keyword:
class Student: Person {
constructor(fName: String,lName: String, age: Int, id: String) : super(fName,lName,age, id)
fun aboutEducation(){
println("I am a student of Computer Science.")
}
fun attendLectures() {
println("I am studding Introduction to Kotlin lecture.")
}
}
The super keyword will call the constructor of the super or parent class to initialize the properties of the parent class.