Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Meaning of Super Keyword [closed]

What's the meaning and usage of the super keyword in Java?

like image 557
User Avatar asked Feb 28 '11 11:02

User


People also ask

What does Super keyword mean?

The super keyword refers to superclass (parent) objects. It is used to call superclass methods, and to access the superclass constructor. The most common use of the super keyword is to eliminate the confusion between superclasses and subclasses that have methods with the same name.

What is super this keywords with example?

super keyword super is used to refer super-class's instance as well as static members. super is also used to invoke super-class's method or constructor. super keyword in java programming language refers to the superclass of the class where the super keyword is currently being used.

What are the 3 uses of super keyword?

Usage of Java super Keyword super can be used to refer immediate parent class instance variable. super can be used to invoke immediate parent class method. super() can be used to invoke immediate parent class constructor.

What is the restriction with super keyword?

Only public and protected methods can be called by the super keyword. It is also used by class constructors to invoke constructors of its parent class. Super keyword are not used in static Method.


1 Answers

super is a keyword in Java. It refers to the immediate parents property.

super()            //refers parent's constructor super.getMusic();  //refers to the parent's method 

- Read More on super

like image 152
jmj Avatar answered Sep 19 '22 22:09

jmj