Polymorphism Introduction
Polymorphism Example in Biology: –Different ‘forms’, same species Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia Light-morph jaguar Dark-morph or black or melanistic jaguar
Polymorphism Example in Biology: –Different ‘forms’ between males and females of the same species Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia
Polymorphism In Java OOP: –Subclasses of a class can define their own unique behaviors and yet share some of the same functionality of the parent class. Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia
Polymorphism public class CylinderDemo { public static void main(String[] args) { Shape shape; shape = new Shape(); System.out.println("Area of current shape: " + shape.getArea()); shape = null; shape = new Circle(10); System.out.println("Area of current shape: " + shape.getArea()); shape = null; shape = new Cylinder(11, 21); System.out.println(" Area of current shape: " + shape.getArea()); shape = null; } Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia
References Oracle. The Java Tutorials. [Online]. Oracle. Java SE Tutorial [Online]. tutorial html tutorial html Oracle. Java SE Downloads [Online]. Harvey M. Deitel and Paul J. Deitel, Java: How to Program, 6th ed.: Prentice Hall, Ken Arnold, James Gosling, and David Holmes, The Java Programming Language, 4th ed.: Addison Wesley Professional, Sharon Zakhour, Scott Hommel, Jacob Royal, Isaac Rabinovitch, and Tom Risser, The Java Tutorial Fourth Edition: A Short Course on the Basics, 4th ed.: Addison Wesley Professional, Y. Daniel Liang, Introduction to Java Programming, 6 th ed.: Pearson Prentice Hall, Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia
References Wikipedia. Sexual dimorphism. [Online]. Wikipedia. Polymorphism (biology). [Online]. Adapted and adopted from Deitel (2004), IBM (2004), Liang (2007), Oracle (2012), and Wikipedia