public void shuffle(){
System.out.println("开始洗牌");
//洗牌 将一副扑克牌顺序打乱
Random random=new Random();
//int l=packOfCards.size()-1;
int i;
Card card1;
for(int a=0;a<52;a++){
do{ i=random.nextInt(51);
card1=packOfCards.get(i);
packOfCards.set(a, new Card(card1.face,card1.number));
}while(packOfCards.contains(card1));
}
random.nextInt(a);范围是[0,a),填52
洗牌一句话带过
Collections.shuffle(cardsList);
shuffle() 自带的类 比较方便