public class Rabbit implements Comparable { private final String breed; private final double birthdate; private final String iD; @SuppressWarnings("unused") private Rabbit() { breed=null; birthdate=0; iD=null; } public Rabbit(String breed, double bday, String id) { this.breed=breed; this.birthdate=bday; this.iD=id; } public String toString() { return String.format("%s %s %10.4f", breed, iD, birthdate); } public String getId() { return iD; } @Override public int compareTo(Rabbit r) { return iD.compareTo(r.getId()); } }