public abstract class PIMEntity { String Priority; // every kind of item has a priority static int nextid=0; // each entity has a unique id protected int id; // default constructor sets priority to "normal" PIMEntity() { Priority = "normal"; id = nextid++; } // priority can be established via this constructor. PIMEntity(String priority) { Priority = priority; id = nextid++; } // accessor method for getting the priority string public String getPriority() { return Priority; } // method that changes the priority string public void setPriority(String p) { Priority = p; } // This is actually already defined by the super class // Object, but redefined here as abstract to make sure // that derived classes actually implement it abstract public String toString(); }