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 forthcoming tabulate definitions, and then exculpation the questions that follow: national enum idea0fDiet f > CARNIVORE, HERBIVORE OMNIVORE national interface Pet f national String who0wnsMeO; national String whatIsMyName); national vacant changeSpectry (String newName); national tabulate mammal armed boolean hasATail; national int numOfLegs; national idea0fDiet eats; national mammal(boolean subject, int legs, ideaOfDiet eats)f hasASubject subject; nunOfLegs = legs; this.eats = eats; drift java.util.Scanner; national tabulate Dog extends mammal ( national boolean hasAnOwner; peculiar String ownerName; peculiar String spectry; peculiar String foster; national Dog(String foster, boolean subject, int legs, ideaOfDiet eats, boolea hasAnOwner, String spectry, String ownerName) super(tail, legs, eats); this.foster = foster; this. hasAnOwner hasAnOwner;
    media%2Fbfd%2Fbfd8435b-cd45-4836-9c70-98

    = 8.75-0.5 Read the forthcoming tabulate definitions, and then exculpation the questions that follow: national enum idea0fDiet f > CARNIVORE, HERBIVORE OMNIVORE national interface Pet f national String who0wnsMeO; national String whatIsMyName); national vacant changeSpectry (String newName); national tabulate mammal armed boolean hasATail; national int numOfLegs; national idea0fDiet eats; national mammal(boolean subject, int legs, ideaOfDiet eats)f hasASubject subject; nunOfLegs = legs; this.eats = eats; drift java.util.Scanner; national tabulate Dog extends mammal ( national boolean hasAnOwner; peculiar String ownerName; peculiar String spectry; peculiar String foster; national Dog(String foster, boolean subject, int legs, ideaOfDiet eats, boolea hasAnOwner, String spectry, String ownerName) super(tail, legs, eats); this.foster = foster; this. hasAnOwner hasAnOwner;

    Expert Exculpation

     

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

    7) national String whoOwnsMe() ;

    national String whatIsMyName() ;

    national vacant changeName(String newName) ;

    8) That technique is indicated originator overloading. As crave as originator attestation referable identical we can designate multiple originators
    This technique is public as Originator overloading, Means identical discharge spectry with diff arguments catalogue.

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