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

List in Descending order

Anu satya
Ranch Hand

Joined: Mar 17, 2005
Posts: 146
Hi all,

This is the code for adding elements to list and display it in sorted manner. It is sorted from A-Z. I want to sort the list from Z-A. How to do it?

Please help

With Regards,
Maneesh Godbole
Saloon Keeper

Joined: Jul 26, 2007
Posts: 10824

Check out Collections#reverse() and Collections#reverseOrder()

[How to ask questions] [Donate a pint, save a life!] [Onff-turn it on!]
I agree. Here's the link:
subject: List in Descending order
It's not a secret anymore!