/** * A class for a generic pet. * This class is not expected to be instantiated * @author gtowell * Created: Feb 2021 */ public class Pet extends Object { // the unique ID of the pet, eg dkhjfusd34 protected String iD; // the name of the pet protected String name; /** * The sound the pet makes * @return a string representation of the sound */ public String sound() { return "silence"; } // No comment needed for get/set accessors public String getId() { return iD; } public String getName() { return name; } /** * Pets are equal iff they have the same Id * @param p * @return */ public boolean equals(Pet p) { return iD.equals(p.getId()); } }