Question: class Main { public static void main(String[] args) { //Create an array of type Animal, size 8 //Insert 4 Dogs and 4 Humans into your
class Main { public static void main(String[] args) { //Create an array of type Animal, size 8
//Insert 4 Dogs and 4 Humans into your array
//Write a loop to go through the array and call 2 methods that will compile WITHOUT downcasting
//Write a loop to go through your array
//In the loop, check to see if the reference is of type Dog, if so, downcast and call a Dog specific method
//In the loop, check to see if the reference is of type Human, if so, downcast and call a Dog specific method } }
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
