aspose file tools*
The moose likes Beginning Java and the fly likes Sorting two calendar years Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Beginning Java
Bookmark "Sorting two calendar years" Watch "Sorting two calendar years" New topic
Author

Sorting two calendar years

Amrita Datta
Greenhorn

Joined: Mar 13, 2009
Posts: 3
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

Joined: Oct 27, 2005
Posts: 19759
    
  20

What is in the list?


SCJP 1.4 - SCJP 6 - SCWCD 5 - OCEEJBD 6
How To Ask Questions How To Answer Questions
Jeanne Boyarsky
author & internet detective
Marshal

Joined: May 26, 2003
Posts: 30913
    
158

One place to start is the Comparator class. It lets you define a specific sort order as being different from the default.


[Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sorting two calendar years