Java Polymorphism
Java Polymorphism
Polymorphis
m
Polymorphism means "many forms", and it occurs when we have
many classes that are related to each other by inheritance.
Like we specified in the previous chapter; Inheritance lets us
inherit attributes and methods from another class.
class Animal {
public void animalSound() {
System.out.println("The animal makes a sound");
}
}