I got a question about sorting an array.
i got an array like this:
long[][] allDate = new long[lenght][2];
and the valus are:
allDate[][0] represend date in miliseconds
and allDate[][1] represend value in this case its price of date from before
for example
allDate[0][0] = 142142141
allDate[0][1] = 90
allDate[][0] value of date is always in future from now
and what i want to do is to sort this dates in ascending chronological logic.
but the problem is i want to keep their price so i could do add it to my Jfreechart line chart.
in this loop
for (int i = 0; i < a7; i++) {
int day = (int) (new Date().getTime() + allDate[i][0] / (1000 * 60 * 60 * 24));
int month = (int) (new Date().getTime() + allDate[i][0] / (1000 * 60 * 60));
int year = (int) (new Date().getTime() + allDate[i][0] / (1000 * 60));
s1.add(new Day(day, month, year), (eWallet + allDate[i][1]));
}
any ideas how to sort it ?