What is the super keyword?

0 votes
47 views
Shikhar Arora asked 07-Dec-2019 in Technology by Shikhar Arora

What is the super keyword

1 Answer

0 votes
Sangsaptak Pal answered 10 days ago by Sangsaptak Pal
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.