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 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
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
