// source: Revised from source codes available at http://www.xyzws.com/Javafaq/what-is-runtime-polymorphism-in-java/16

 

Exercise: Examine the Java programs; run the application in JDK first and then in NetBeans.

Note: Check the instructions in http://sce.uhcl.edu/yang/teaching/JavaPackages.htm for ways of handling packages in JDK and NetBeans.

 

 

A.     Source files:

Animal.java                        Dog.java                             Cat.java

Bird.java                             RuntimePolymorphismDemo.java

B.     Sample Output Screen: