/** * Rabbit breeds */ enum BreedEnum { DwarfDutch, Angora, FrenchLop } /** * A simple class to capture dataabout rabbits */ public class Rabbit implements Comparable { private final BreedEnum breed; private final String iD; private final int age; /** * Create a rabbit */ public Rabbit(BreedEnum breed, String id, int age) { this.breed = breed; this.iD = id; this.age = age; } @SuppressWarnings("unused") private Rabbit() { this.breed = BreedEnum.Angora; this.iD = null; this.age = -1; } public boolean equals(Rabbit otherRabbit) { return otherRabbit.getId().equals(this.iD); } public String getId() { return iD; } public String toString() { return breed + " " + iD + " " + age; } @Override public int compareTo(Rabbit o) { return iD.compareTo(o.getId()); } public static void main(String[] args) { System.out.println("Hello rabbit"); } }