This week's book giveaway is in the JDBC forum.
We're giving away four copies of Make it so: Java DB Connections & Transactions and have Marcho Behler on-line!
See this thread for details.
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

Win a copy of Make it so: Java DB Connections & Transactions this week in the JDBC forum!
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: 10769

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!