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,



Python Recommendations:

C++ & C++11 Recommendations:

If you didn't find what you were looking, then do suggest us in the comments below. We will be more than happy to add that.

Subscribe with us to join 1500+ Python & C++ developers, to get more Tips &  Tutorials like this.