I implemented my own class myclass
. I wrote following code for sorting
Arrays.sort(arrayForSortingInterval, new Comparator<myclass>() {
public int compare(myclass o1, myclass o2) {
return o1.minute <= o2.minute ? 1 : 0;
}
});
My array is declared as myclass[] arrayForSortingInterval = new myclass[lengthIntervalArray*2];
and myclass has two integer values minute
and tag
.
But this sorting code doesn't seem to work.
UpperCamelCase
. – Boris the Spider Jan 14 '14 at 15:46Integer.compare(o1.minute, o2.minute);
? – user2336315 Jan 14 '14 at 15:47