Polymorphism
Polymorphism After overriding a super class method in a sub class, casting and running the super class method through the super class reference is polymorphism. Simply put, the process of calling the sub class method from the super class reference using the 3 concepts of overriding, inheritance, and casting can be described as polymorphism. Figure 1 : Polymorphism Example As shown in this simple example, the subclass method is called by both upcasting and downcasting. Figure 2 : Polymorphism Example This code creates an " Employee " superclass and two subclasses, " Manager " and " Programmer ". The " Employee " superclass has a single method called " work " that simply prints out "The employee works". Both " Manager " and " Programmer " are subclasses of " Employee " and they override the " work " method with their respective tasks. The " Manager " subclass has an additional