我有一个包含 CricketLiveScore 对象的 ArrayList
CricketLiveScore{
String homeAbbrevation;
}
List myList=new ArrayList<CricketLiveScore>();
CricketLiveScore c1=new CricketLiveScore();
c1.setHomeAbbrevation("IND vs PAK");
CricketLiveScore c2=new CricketLiveScore();
c2.setHomeAbbrevation("SRI vs NWZ");
CricketLiveScore c3=new CricketLiveScore();
c3.setHomeAbbrevation("AUS vs BAN");
CricketLiveScore c4=new CricketLiveScore();
c4.setHomeAbbrevation("NWZ vs IND");
list.add(c1);
list.add(c2);
list.add(c3);
list.add(c4);
我需要基于 Object 对这个 Arraylist 进行排序,其值 IND 在 home abbrevation 有人可以帮助解决这个问题,以便我需要一个列表进行排序并显示输出首先包含 IND 的值。