Answer (Choose 1 answer)
A. The code will compile and run.
B. The code will compile but will throw an exception at line 6.
C. Line 6 will not compile.
D. The code will compile and run, but the cast in line 6 is not required and can be eliminated.
E. Line 5 will not compile.
Consider the following code:
1. Dog rover, fido;
2. Animal anim;
3.
4. rover = new Dog();
5. anim = rover;
6. fido = (Dog)anim;
Where:
Mammal extends Animal Dog extends Mammal
Which of the following statements is true?