I have a list of list in java where all the elements are string like below,
[livelongandprosper, 2, 1]
[deals, 11, 1]
[SEO, 5, 1]
[Bible, 8, 1]
[EarnHistory, 2, 1]
[God, 2, 0]
[inktober2017, 3, 0]
[Brand, 22, 1]
[CoreyFedman, 1, 1]
[HappyHalloween, 5, 0]
[innisfree, 1, 1]
[WorldSeries, 3, 1]
[Scocco, 1, 1]
How can I sort the values of the above list of list on the basis of values in second column and in descending order?
>>(){ public int compare(List o1, List o2)
{
//Simple string comparison here, add more sophisticated logic if needed.
return o1.get(1).compareTo(o2.get(1));
}
}); This is not working
– Kartik Khurana Nov 01 '17 at 01:51