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. interface Animal 2 int number of legs(); 1 N 1 4 5 interface Mammal extends Animal interface Reptile extends Animal () clans Cat implements Mammal public int number of Legs ( return; ) ) 14 clans Tiger extenda Cat O 9 10 11 12 13 16 10 IN 19 20 class Bnake implements Reptile public int number of legs() return 0; 3 > Animal numberOfLegs(int > Mammal 11st1, 118t2; . 10 11 18 14 15 animalt - new Tiger(); snake1-new Animal(); animal2 - new Animal(); cat1 - new Tiger); mannalt - Dev Snake(); tiger1 Bannall: animal3cati 11sti = new ArrayList ; 11st2 -new ArrayList Reptile(); 11 IN 19 200 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!