What is the super keyword?

Asked 6 years ago 911 views

1 Answer


0
Super is a keyword in Java generally used in the context of inheritance. The super keyword in Java is a reference keyword that is used to refer parent class objects. It is used with variables, methods and constructors. It is used with variables to access the base class variables having same name as  that of the derived class. In the context of methods, it is used to access the base class functions or methods having same name as the derived class. It is also used to call the parent or base class constructor. It helps in resolving ambiguity between variables, methods and constructors having same name in both base and derived class.

Write Your Answer