Collections.sort(playerList.get(0).pokers,new TestPoker());
public TestPoker(){
this.playerList=new ArrayList <Player>();
PokerList this.pokerList=new ArrayList<Poker>();
this.pokerListAfterShuffle=new ArrayList<Poker>(); console=new Scanner(System.in);
String[] pokerPoint={"2","3","4","5","6","7","8","9","10","J","Q","K","A"}; String[] pokerColor={"方片","梅花","红桃","黑桃"};
for(String point:pokerPoint){ for(String color:pokerColor){ Poker pk=new Poker(point,color); pokerList.add(pk); } } }
_____________
Collections.sort(playerList.get(0).pokers,new TestPoker()); 这个写在给集合排序的sort里的
new TestPoker()是真的看不懂什么意思,希望大佬跟我说一下
zzZerOrz
相关分类