Quick Instantiation Question
This came to my attention on page 274:
Animal animalArray = new Animal;
Cow myCow1 = new Cow("Deirdre");
animalArray = myCow1;
animalArray = new Chicken("Ken");
My question is why do you need to prefix myCow1 with Cow, but you do not need to prefix animalArray with Chicken.
In this line: Cow myCow1 = new Cow("Deirdre");
The first Cow is the type (like int, string, etc.), and the second Cow() is the constructor, correct?
So why does the Chicken not need the type declaration?