Question: A4. Given the following class diagram, interfaces and classes that model various kinds of animals. What will be the errors in the main method? For

 A4. Given the following class diagram, interfaces and classes that model

A4. Given the following class diagram, interfaces and classes that model various kinds of animals. What will be the errors in the main method? For each error, indicate the line number of each incorrect statement and explain in one sentence why it is wrong. 5 1 2 3 4 5 interface Animal { int number of Legs(); ) interface Mammal extends Animal > Animal numberOfLegs(): int 7 8 9 10 interface Reptile extends Animal () class Cat implements Mammal { public int number of Legs() { return 4; ) ) 12 13 14 > Mammal > Reptile 4 10 17 18 19 20 21 class Tiger extends Cat class Snake implements Reptile { public int number of Legs() { return 0; ) 3 Cat +numberOfLegs(): int Snake +numberOfLegs(): int Tiger 1 2 3 4 public class Animals { public static void main(String[] args) { Animal animali, animal2, animal3; Mammal mannalt; Cat cati; Snake snaket; Tiger tigert; List(); 11st2 = new ArrayList(); 15 16 17 18 19 } 20 3

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!