1. I have a Collection of 'JT' objects. JT has date, description, amount as its properties.
2. I want to sort this collection based on a key specified by the user (date, desc, amt). What is the best way to do this in
Java?
3. Additionally, the sorting could either be ascending or descending, based on what the previous sorting was. e.g. if the previous sort was date ascending, the current sort has to be date descending.
I want to use the Comparator, but don't know how (or if) to use it.
Thanks in advance!