Arrays of Subclass Objects
Arrays of any type object can be created (concrete or abstract).
Once the objects are in the array, they can be manipulated as any other object.
public class AnimalArray
{
public static void main(String[] args)
{
Animal[] ref = new Animal[3];
Dog adog = new Dog("Waldo");
Cat acat = new Cat("Buster");
Cow acow = new Cow("Marple");
ref[0]=adog;
ref[1]=acat;
ref[2]=acow;
for(int x=0;x<3;x++)
ref[x].speak();
}
}