The ArrayList doesn't implement Comparable. The Objects being stored in the ArrayList implement Comparable. If you don't want to do that, create a Comparator that does the same thing.
For more...
Type: Posts; User: KevinWorkman
The ArrayList doesn't implement Comparable. The Objects being stored in the ArrayList implement Comparable. If you don't want to do that, create a Comparator that does the same thing.
For more...
Huh? That's not at all how that method works. The sort() method is void, so it doesn't return anything. Did you read the API link I gave you?
What are you confused about? You have an ArrayList of Customers, right? So make a Comparator for Customer (or make the implement Comparable) that sorts them in whatever fashion you want.
Did you check out the API for Collections?
Collections (Java Platform SE 6)
Why don't you just use the Collections class and a Comparator?