What is super keyword in Java?



vikas Said

+0 -0

The "super" keyword in Java is a reference to the parent class of the current class. It is used to access members of the parent class that have been overridden in the current class.
For example, if a class "Child" extends a class "Parent" and overrides a method "SmallCode()", the Child class can still access the original implementation of the "SmallCode()" method in the Parent class by using the "super" keyword.
The "super" keyword is also used to access the parent class's variables if the child class has variables with the same name.



Submit Your Response