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 mamber of each incorrect statement and explain in one sentence why it is wrong. interface Animal ( int numberorlags(); 3 4 interface Mammal extends Animal interface Reptilo extends Animal () > Animal numberOfLegs(int T 10 class Cat implements Mannal public int numberorlags() return 4: 12 18 > Mammal > Reptile K 15 10 class Tiger extends Cat 11 IN clano Sanke implesente Reptilo public int numberortage return 0; Cat 19 +numberOfLegs(int Snake +numberOfLegs(int 21 Tiger public class animals public static void mainStringar Antal ansat na 12 antal 17 18 19 20 21 class Sanke implemento Reptilo { public int numberor Lagoo ( return 0; 3 ) Cat +numberOfLegs0 : int Snake +numberOfLegs : int Tiger 3 4 public class Animals public static void main(String[] args) { Animal animali, anima12, animal3; Mamal mannali Cat cati: Snake snake Tiger tiger1 List
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
