Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Contact implements Comparable<Contact> {
- private String firstName;
- private String lastName;
- private String phone;
- private String address;
- private int age;
- private String organization;
- private String group;
- public int compareTo(Contact other) {
- return firstName.compareTo(other.firstName);
- }
- }
- ----------------------------------------------------------------
- // The ArrayList can be declared like this:
- List<Contact> contacts = new ArrayList<Contact>();
- // ... At the beginning of execution.
Add Comment
Please, Sign In to add comment