+ 7
What is the use of super keyword ?
3 ответов
+ 4
It's basically just to access the super class of a class if it is inheriting from another class.
For example, if you were to have a class Animals with a class inheriting from it known as Dog, Dog would be the subclass of Animals and Animals would be the superclass of Dogs. The super keyword being used in the Dogs class will access the Animals class.
Hope this helped!
+ 4
It is used to pass values to the super class and to access its variables or methods using it's subclass.