The super
Keyword
The super
keyword refers to superclass (parent) objects.
If a class is inheriting the properties of another class and if the members of the superclass have the names same as the subclass, to differentiate these variables we use super
keyword as follows:
super.variable
super.method( );
If a class is inheriting the properties of another class, the subclass automatically acquires the default constructor of the superclass.
But if you want to call a parameterized constructor of the superclass, you need to use the super
keyword as follows:
super( values );
Let the cat out of the bag.
|