Question: using java, and g iven the following class diagram, interfaces and classes that model various kinds of animals. What will be the errors in the

using java, and gusing java, and given the following class diagram, interfaces and classes thativen 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.

1 2 interface Animal { int number of Legs(); 3 4 > Animal numberOfLegs(): int interface Mammal extends Animal ? interface Reptile extends Animal ( class Cat implements Mammal { public int number of Legs() { return; } 10 11 12 > Mammal > Reptile ) A 14 15 16 17 class Tiger extends Cat class Snake implements Reptile public int number of Logs() { return 0; Cat +numberOfLegs(): int Snake +numberOfLegs(): int 19 20 2 Tiger public class Animals public static void main(String args) { Animal animali, animal, animal3; Mammal mannall; Cat cat1; Snake snaken; Tiger tigert; List list1, 11st2; animali - Dev Tiger(); snakei - De Animal(); animal2 = new Animal(); cat1 - Dew Tiger(); mannalt - new Snake(); tiger1 mannal1; animal3 - catt; 11sti -new ArrayList(); 11st2 -new ArrayList(); 12 13 14 16 17 1N 19

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!