Given:
Animal= superclass,
Dog= subclass,
Cat= subclass.
In the following code fragment, the bottom two lines generate compile-time errors. Provide corrected versions of those two lines. Preserve the spirit of the original code. For example, the bottom line should assign the second
animalselement into the
fluffyvariable.
Animal[] animals = new Animal[20];animals[0] = new Dog();animals[1] = new Cat();Dog lassie = animals[0];Cat fluffy = animals[1];
We need at least 10 more requests to produce the solution.
0 / 10 have requested this problem solution
The more requests, the faster the answer.