PhoneBookCollection phoneBook = new PhoneBookCollection();
I have an ArrayList of PhoneBook objects. (The getCollection method returns the list)
ArrayList<PhoneBook> list = phoneBook.getCollection();
I then iterate through my ArrayList and get the PhoneBook at the i'th index and get its corresponding Telephone.
for(int i = 0; i < list.size(); i++ ){
String phone = phoneBook.getPhoneBook(i).getTelephone();
}
What I want to be able to do now is sort the getTelephone objects in ascending order.
I know that ArrayLists don't have a sort method so i'm having a bit of trouble doing this.
PhoneBookComparatorand useCollections.sort().