In this article we will discuss how to call parent class’s overridden method from a derived class method in Java.

Suppose we have a Base class which has a function display() i.e.

Now we will create a Derived class that will extend this Base class i.e.

In this class we will override the display() function i.e.

Now if we create a Derived class object and call this overridden display() function from it , then due to dynamic binding in Java, always derived class display() method will be called i.e.

Now, if we want to call Base class’s display() function from the Derived class’s display() function, then how to do that ? Answer is using super keyword.

Calling Parent class’s overridden method from Child class’s method using super keyword


from Derived class function will call base class version of display() function i.e.

Complete code is as follows,



Click Here to Subscribe for more Articles / Tutorials like this.