Fill in countDogs so that it returns how many elements of the array are really Dog objects.
countDogs
Dog
The array is typed Animal[], so you cannot tell by the declared type — ask each object with instanceof. The program prints 2 and then 0.
Animal[]
instanceof
2
0