October 2018
Intermediate to advanced
370 pages
9h 15m
English
The super keyword is used to call the functions of the parent class. In the following example, we call the displayInfo() function from the Student class by using the super keyword:
override fun displayInfo() { super.displayInfo() println("I am a student of $education in $institutionName and my ID is $studentID")}
Notice that by calling the parent class, the function in the child class displays the same output as before.
Read now
Unlock full access