/* Author : Michael Robinson Program : polimorphicArrays.java Purpose : This program creates an array of objectBuilder data type then it loads sub-classes into array prints backwards array contents prints forwards array contents Updated : September 23rd, 2099 */ public class polimorphicArrays { public static void main( String arg[] ) { //create an array of objectBuilder data type polySuper array[] = new polySuper[3]; //load sub-classes into array array[0] = new sub1(); array[1] = new sub2(); array[2] = new sub3(); //print backwards array contents for( int temp = array.length -1; temp > -1; temp-- ) { array[temp].myName(); } System.out.println(); //print forwards array contents for( polySuper temp : array ) { temp.myName(); } }//end public static void main( String arg[] ) }//end public class polimorphicArrays