File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes Java in General and the fly likes Sort song titles Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Sort song titles" Watch "Sort song titles" New topic

Sort song titles

Cynthia Yeo

Joined: Feb 13, 2003
Posts: 3
how can i sort the titles of the songs in descending order by using String.comparTo() method?
Peter den Haan
Ranch Hand

Joined: Apr 20, 2000
Posts: 3252
Collections.sort(songs, Collections.reverseOrder());
Assuming that "songs" is a List of song titles or Song objects that have a sensible natural ordering. If not, then please tell us a bit more about your problem.
- Peter
I agree. Here's the link:
subject: Sort song titles
It's not a secret anymore!