In Java, I have a List of List that looks something like the following:
[ ["Kelly", "3.0"], ["Jeff", "2.0"], ["Mark", "1.0]" ]
How do I sort the list by a certain index? In this case, index of 1
Ex)
Given: [ ["Kelly", "3.0"], ["Jeff", "2.0"], ["Mark", "1.0"] ]
Desired: [ ["Mark", "1.0"], ["Jeff", "2.0"], ["Kelly", "3.0"] ]
What I'm looking for is something very similar to the 'sorted()' method in Python (the exact solution I'm looking for in Python shown here: https://www.kite.com/python/answers/how-to-sort-a-list-of-lists-by-an-index-of-each-inner-list-in-python and here: sort list of lists by specific index of inner list) but I'm looking for a solution in Java.
Also as a bonus, how would I sort these in descending order? What about instances of same values (i.e. there's multiple '3.0' values)