* that is, hours 12 and minutes 30. */ public void replaceDefective() Consider the hierarchy of classes shown for a small part of a bird sanctuary. Notice that an a and an The class is Owl is-a Bird, SnowyOwl is-a Owl, ElfOwl is-a Owl. Bird specified as an class as shown in the following declaration. Each has a name and a noise that abstract Bird are specified when it is constructed. public abstract class Bird { private String myName; private String myNoise; /** * Constructor for objects of class Bird */ public Bird(String name, String noise) { myName = name; myNoise = noise; } public String getName() { return myName; } public String getNoise() { return myNoise; } public abstract String getFood(); } An is a whose noise is The food it eats depends on the type of which means that “hoot”. Owl Bird Owl, cannot be implemented in the class. getFood Owl Given the hierarchy shown above, write a complete class declaration for the class including its constructor Owl,
* that is, hours 12 and minutes 30. */ public void replaceDefective() Consider the hierarchy of classes shown for a small part of a bird sanctuary. Notice that an Owl is-a Bird, a SnowyOwl is-a Owl, and an ElfOwl is-a Owl. The class Bird is specified as an abstract class as shown in the following declaration. Each Bird has a name and a noise that are specified when it is constructed. public abstract class Bird { private String myName; private String myNoise; /** * Constructor for objects of class Bird */ public Bird(String name, String noise) { myName = name; myNoise = noise; } public String getName() { return myName; } public String getNoise() { return myNoise; } public abstract String getFood(); } An Owl is a Bird whose noise is “hoot”. The food it eats depends on the type of Owl, which means that getFood cannot be implemented in the Owl class. Given the hierarchy shown above, write a complete class declaration for the class Owl, including its constructor
practice_exam_3.docx