I have a 2d array of integers which hold a date: the month is at index 0, the day at index 1, and the year at index 2
date [0][0] = 10;
date [0][1] = 14;
date [0][2] = 2013;
System.out.println(date[0][0] + "-" + date[0][1] + "-" + date[0][2]);
OUTPUT:
10-14-2013
If I had lots of these, would it be possible to sort these dates in chronological order?
This is what I have so far:
for(int i =0; i < date.length; i++)
{
Arrays.sort(date[i]);
}
but this, instead, switches my day with the month.
After searching, I found that a few people on the stack were using the comparator class for sorting. Is it possible to use that?