Shanna Irl wrote:... Address cannot be cast to java.lang.Comparable"...
Your program expects your Address objects to be
Comparable. Note that "Comparable" is different than "Comparator." A Comparable object has the ability to compare itself to other objects. A Comparator object has the ability to compare 2 objects to each other.
When you call Collections.sort, you can either call...
Collections.sort(List list), which expects your List to contain Comparable objects. Or you can call...
Collections.sort(List list, Comparator c), in which you provide a Comparator instance to do the comparisons.
You probably just want to implement Comparable instead of Comparator.