PPT Slide
public static void main(String[ ] argv) {
Animal[ ] = animalArray[3];
animalArray[0] = new Bird( );
animalArray[1] = new Dog( );
animalArray[2] = new Fish( );
for (1=0; 1 < animalArray.length; iIndex++)
if (animalArray[iIndex] instanceof Dog)
{ d = (Dog) animalArray[iIndex];
We cast before calling bark() because only dogs can bark. So some array members cannot execute the method