我有这个数组:
ArrayList<String[]> passes = new ArrayList<>();
我想按每个数组的索引对这个数组进行排序。
例如,如果 ArrayList 看起来像这样:
{banana, cherry}
{apple, donut}
{apple, carrot}
排序看起来像:
{apple, carrot}
{apple, donut}
{banana, cherry}
因为字母表中 a 在 b 之前,在香蕉数组上方有两个苹果数组。然后胡萝卜数组越过甜甜圈数组,因为 c 在 d 之前。