D.2.3+Define+the+term+polymorphism

What is Polymorphism?
Polymorphism is the ability to create a variable, a function, or an object that has more than one form.

Polymorphism allows you to create a subclass of an existing class and redefine how a method works, so that when the method is called by other code (or even the super class's code) your method is executed instead.

Example of Polymorphism
class Employee { zzzzz public void work { zzzzzzzzzz System.out.println("I am an employee.");

zzzzz } } class Manager extends Employee { zzzzz public void work { zzzzzzzzzz System.out.println("I am a manager.");

zzzzz } zzzzz public void manage { zzzzzzzzzz System.out.println("Managing ...");

zzzzz } } public class PolymorphismTest1 { zzzzz public static void main(String[] args) { zzzzzzzzzz Employee employee; zzzzzzzzzz employee = new Manager; zzzzzzzzzz System.out.println(employee.getClass.getName); zzzzzzzzzz employee.work; zzzzzzzzzz Manager manager = (Manager) employee; zzzzzzzzzz manager.manage; zzzzz } }