Sort collection of objects in HashMap based on the object's variable
Posted
by chandra wibowo
on Stack Overflow
See other posts from Stack Overflow
or by chandra wibowo
Published on 2010-05-11T07:26:18Z
Indexed on
2010/05/11
8:14 UTC
Read the original article
Hit count: 226
I have a collection of book objects in a HashMap. The book has book_title, book_author, book_year_published, etc. I want to sort them based on the book_title which is a String, in both ascending and descending order, and display them on the screen.
I wish someone can help me - I have been doing this for hours and still havent come up with a solution. Thanks in advance.
© Stack Overflow or respective owner