#Java | Method Overriding | Polymorphism | Dynamic Method Dispatch | Telugu | Dr.Venkat | Python Cpp

preview_player
Показать описание
Method Overriding: Method overriding is an example of Polymorphism.
Poly means many and morphic means many forms.
One thing performs many actions.

Method Overriding: Super class method and sub class methods having same names with same signature i.e, no. of the parameter of the method and data types of the parameters are same.

When Method Overriding occurs, using sub class object we can only call sub class method.
To call super class method we use the keyword super.

Example Program:
------------------------------------
class Parent{
public void display(){
}
}
class Child extends Parent{
public void display(){
}
}
class Main{
public static void main(String args[]){
Child c = new Child();
}
}

---------------------------------------------------
Abstract classes and interfaces are also the examples of Polymorphism.
Abstract classes and interfaces are also examples of Data Abstraction. Since, methods code are hidden.

Link for Abstract class:

Link for Interfaces:

For any queries please write in the comment box.

Dr. Venkateshwarlu.
Рекомендации по теме
Комментарии
Автор

Very clear explanation sir
Wonderfully 😊🎉 delivered sir

Ammu-tj
Автор

Thanks for your patience sir..❤Keep doing sir

PDM-pu
Автор

Sir what is mean by dynamic dispatch method

nandinimotipalli-vpyp
visit shbcf.ru