Differences :
SUPER | SUPER() |
---|---|
The super keyword in JAVA is a reference variable that is used to refer parent class objects. | The super() in JAVA is a reference variable that is used to refer parent class constructors. |
super can be used to call parent class’ variables and methods. | super() can be used to call parent class’ constructors only. |
The variables and methods to be called through super keyword can be done at any time, | Call to super() must be first statement in Derived Class constructor. |
If one does not explicitly invoke a super class variables or methods, by using super keyword, then nothing happens | If a constructor does not explicitly invoke a super class constructor by using super(), the Java compiler automatically inserts a call to the no-argument constructor of the super class. |
No comments:
Post a Comment