Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Sorting two calendar years  RSS feed

 
Amrita Datta
Greenhorn
Posts: 3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I need to sort an array list based on two different calendar years.
The information that we get in the current calendar year shoud be displayed first followed by the previous calendar year.

Am unable to sort the information based on the 2 calendar years.

 
Rob Spoor
Sheriff
Posts: 20895
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What is in the list?
 
Jeanne Boyarsky
author & internet detective
Sheriff
Posts: 36441
454
Eclipse IDE Java VI Editor
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One place to start is the Comparator class. It lets you define a specific sort order as being different from the default.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!