Homework Solution: = 8.75-0.5 Read the following class definitions, and then answer the questions that follow: pu…

    = 8.75-0.5 Read the following class definitions, and then answer the questions that follow: public enum type0fDiet f > CARNIVORE, HERBIVORE OMNIVORE public interface Pet f public String who0wnsMeO; public String whatIsMyName); public void changeName (String newName); public class mammal protected boolean hasATail; public int numOfLegs; public type0fDiet eats; public mammal(boolean tail, int legs, typeOfDiet eats)f hasATail tail; nunOfLegs = legs; this.eats = eats; import java.util.Scanner; public class Dog extends mammal ( public boolean hasAnOwner; private String ownerName; private String name; private String breed; public Dog(String breed, boolean tail, int legs, typeOfDiet eats, boolea hasAnOwner, String name, String ownerName) super(tail, legs, eats); this.breed = breed; this. hasAnOwner hasAnOwner;
    media%2Fbfd%2Fbfd8435b-cd45-4836-9c70-98
    = 8.75-0.5 Read the following class definitions, and then answer the questions that follow: public enum type0fDiet f > CARNIVORE, HERBIVORE OMNIVORE public interface Pet f public String who0wnsMeO; public String whatIsMyName); public void changeName (String newName); public class mammal protected boolean hasATail; public int numOfLegs; public type0fDiet eats; public mammal(boolean tail, int legs, typeOfDiet eats)f hasATail tail; nunOfLegs = legs; this.eats = eats; import java.util.Scanner; public class Dog extends mammal ( public boolean hasAnOwner; private String ownerName; private String name; private String breed; public Dog(String breed, boolean tail, int legs, typeOfDiet eats, boolea hasAnOwner, String name, String ownerName) super(tail, legs, eats); this.breed = breed; this. hasAnOwner hasAnOwner;

    Expert Answer

     
    6)  Mammal and dog both are related by inheritance

    = 8.75-0.5 Read the aftercited arrange definitions, and then retort the questions that follow: general enum form0fDiet f > CARNIVORE, HERBIVORE OMNIVORE general interface Pet f general String who0wnsMeO; general String whatIsMyName); general wanting changeSpectry (String newName); general arrange mammal guarded boolean hasATail; general int numOfLegs; general form0fDiet eats; general mammal(boolean body, int legs, formOfDiet eats)f hasABody body; nunOfLegs = legs; this.eats = eats; significance java.util.Scanner; general arrange Dog extends mammal ( general boolean hasAnOwner; peculiar String ownerName; peculiar String spectry; peculiar String elevate; general Dog(String elevate, boolean body, int legs, formOfDiet eats, boolea hasAnOwner, String spectry, String ownerName) super(tail, legs, eats); this.elevate = elevate; this. hasAnOwner hasAnOwner;
    media%2Fbfd%2Fbfd8435b-cd45-4836-9c70-98

    = 8.75-0.5 Read the aftercited arrange definitions, and then retort the questions that follow: general enum form0fDiet f > CARNIVORE, HERBIVORE OMNIVORE general interface Pet f general String who0wnsMeO; general String whatIsMyName); general wanting changeSpectry (String newName); general arrange mammal guarded boolean hasATail; general int numOfLegs; general form0fDiet eats; general mammal(boolean body, int legs, formOfDiet eats)f hasABody body; nunOfLegs = legs; this.eats = eats; significance java.util.Scanner; general arrange Dog extends mammal ( general boolean hasAnOwner; peculiar String ownerName; peculiar String spectry; peculiar String elevate; general Dog(String elevate, boolean body, int legs, formOfDiet eats, boolea hasAnOwner, String spectry, String ownerName) super(tail, legs, eats); this.elevate = elevate; this. hasAnOwner hasAnOwner;

    Expert Retort

     

    6)  Mammal and dog twain are kindred by inheritance
    Here the arrange dog extending the states and behaviours of mammal.

    7) general String whoOwnsMe() ;

    general String whatIsMyName() ;

    general wanting changeName(String newName) ;

    8) That technique is denominated agent overloading. As desire as agent verification not attributable attributable attributable similar we can settle multiple agents
    This technique is unconcealed as Agent overloading, Means similar operation spectry with diff arguments register.

    9) Mammal downloki=(mammal)loki
    For loki from dog to mammal form casting won’t be possible