Near the beginning of chapter 11, there is a section on Collections with a lengthy code example. In the example an abstract base class, Animal, is created with Cow and Chicken classes derived from it.
My understanding is that an abstract class cannot be instantiated. However the example on p. 238 contains this code:
Code:
Animal[] animalArray = new Animal[2];
Cow myCow1 = new Cow("Deirdre");
animalArray[0] = myCow1;
It appears to me that this code is instantiating the Animal class by creating an array of two Animal objects.
Can you explain what I am missing about not being able to instantiate an abstract class?