I have an arraylist class in the Events class, where the Events class is similar to
class Events {
Date eventDate;
String eventType;
}
Now I want to sort this array first based on the latest eventDate. If two or more events are included on the same date, I will sort them in the following order of event type
1. Maths
2. Science
3. History
4. Algebra.
So if my list
{ "01/01/2010 History", "01/01/2010 Algebra", "01/01/2010 Maths", "01/01/2010 Science"}
Then I want to sort it as
{ "01/01/2010 Maths", "01/01/2010 Science", "01/01/2010 History", "01/01/2010 Algebra"}
Please suggest how can I do this?
TIA, Hanumant.
source
share