Professional Documents
Culture Documents
of
Group 3:
Polymorphism
What is Polymorphism?
It is an oop technique that utilizes
inheritance to create 1 class and make
several classes inherit from that class so
that it can take many forms.
According to Dictionary
"Poly" means "MANY" and
Morph means "Take Different
Forms"
USING Polymorphism
class Animal {
void makeSound(){
//Sound
}
}
class Dog extends Animal void
makeSound(){
//Arf
}
class Cat extends Animal void
} makeSound(){
//Meow
}
}
Java Polymorphism
Polymorphism is one of the basic principles of
Object-Oriented Programming. There are two
types of polymorphism:
• Static Polymorphism
• Dynamic Polymorphism
Polymorphism is the capability of
an action or method to do different
things based on the object.
Compile Time in Java Polymorphism