Polymorphism in Java is the task that performs a single action in different ways.
Java supports polymorphism, it is an Object-Oriented Language.
Polymorphism occurs when there is inheritance, i.e., many classes are related.
Inheritance is a powerful feature in Java.
What is Polymorphism?
The derivation of the word Polymorphism is from two different Greek words- poly and morphs. “Poly” means numerous, and “Morphs” means forms. So, polymorphism means innumerable forms. Polymorphism, therefore, is one of the most significant features of Object-Oriented Programming.
Types of Polymorphism
You can perform Polymorphism in Java via two different methods:
➡️Method Overloading
➡️Method Overriding
Method overloading is the process that can create multiple methods of the same name in the same class, and all the methods work in different ways.
Method overriding is the process when the subclass or a child class has the same method
Static/Compile-Time Polymorphism
Dynamic/Runtime Polymorphism
I study this topic in website i don't know for reason dor this two types
➡️I don't know about this topic to be discussed in tomorrow with trainer
Top comments (0)