Polymorphism. Based on slides from Deitel & Associates, Inc. Revised by T. A. Yang. Outline. Introduction Inheritance and polymorphism Implementing polymorphism in Java: Operator /method Overloading Method Overriding Abstract and Concrete Classes Interfaces. Polymorphism.
Dynamic (or Run-time) binding
versus Static (or compilation-time) binding
Fig. 10.1: Another example of method overriding
public abstract void draw(); // an abstract method
layered software systems
Redraw the interface diagram in the previous slide as an UML diagram with inheritance, by replacing the interface with an abstract class.
public class ClassNameextends SuperclassNameimplementsFirstInterface,SecondInterface, …