I am writing a phonebook program in java and i need to list people in the list alphabetically and to do that i need to write a sorting algorithm for a list in java and it sh
The Person class' signature should be like this:
public class Person implements Comparable
Add compareTo-method to Person class and use Collections.sort(personList) as starf suggested.