/* A ToDo object is something we must do It has a priority, a textual description, and an identification number */ public class ToDo { private int priority; // (1) private String description; // (2) private int id_no; // (3) static private int no_of_items = 0; // (4) /* Attributes (1), (2) and (3) belong to an instance but cannot be accessed directly. (4) is a class variable and cannot be accessed by an instance. Similar to cons in class List. */ public ToDo() { priority = 0; description = ""; no_of_items++; id_no = no_of_items; } // No point if you can't set? public ToDo(int p, String s) { priority = p; description = s; no_of_items++; id_no = no_of_items; } public int getPriority() { return priority; } public String getDescription() { return description; } public int getId_no() { return id_no; } public String toString() { return "[" + priority + " " + description + " " + id_no + "]"; } // for printing! }