I have a list "unSortedDateList" in which dates are stored as CSV. dates are stored in following format (MM/dd/yyyy) 1/10/2012, 2/10/2011, 1/9/2011 *(note: DATES ARE STORE as COMMA SEPERATED VALUE)*
I have written a function which takes these dates from the list and sort them in ASC and store in sortedList.
TreeMap<Date, Date> sortedMap = new TreeMap<Date, Date>();
for (Date theDate : unSortedDateList)
{
sortedMap.put(theDate.getTime(), theDate);
}
List<Date> sortedList = (List<Date>) sortedMap.values();
The program is throwing a cast exception.
Can you please help me what i am doing wrong here?