Win a copy of Programmer's Guide to Java SE 8 Oracle Certified Associate (OCA) this week in the OCAJP forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

List in Descending order

 
Anu satya
Ranch Hand
Posts: 146
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Maneesh Godbole
Saloon Keeper
Posts: 11085
13
Android Eclipse IDE Google Web Toolkit Java Mac Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Check out Collections#reverse() and Collections#reverseOrder()
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic