Question: Consider the following class declarations class Pet f protected String name; protected boolean indoor public String getName) f return name; public boolean getIndoor) return indoor;

Consider the following class declarations class Pet f protected String name; protected boolean indoor public String getName) f return name; public boolean getIndoor) return indoor; class Goat extends Peti public int age; public String diet; public Goat (String name, boolean indoor, int age, String diet) super(name, indoor); this.ageage; this.diet -diet; Complete the constructor of the Pet class Note: Write the entire Pet class in the answer box below. You can assume that the Goat class has been done for you For example Test Result Goat gnew Goat(Danny", false, 3, "Hay"); System.out.printt("%s, %b", g.getName ( ), g.getIndoor()); Danny, false
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
