为了账号安全,请及时绑定邮箱和手机立即绑定

打乱java中的对象数组无法正常工作

打乱java中的对象数组无法正常工作

守着星空守着你 2021-08-19 20:10:22
我创建了一组要洗牌的卡片对象。但是,当我使用简单的 shuffle 方法时,输出不正确。它不是洗牌,而是复制一些卡片并删除其他卡片。这是打印内容的示例Jack of Clubs5 of Hearts4 of Hearts7 of Hearts5 of HeartsAce of Spades8 of Clubs5 of HeartsJack of DiamondsJack of ClubsQueen of DiamondsJack of Diamonds9 of Diamonds4 of HeartsJack of Diamonds3 of Diamonds6 of DiamondsJack of Clubs4 of Hearts10 of DiamondsJack of Diamonds2 of DiamondsQueen of Diamonds7 of Hearts5 of HeartsKing of Diamonds5 of Hearts9 of DiamondsAce of Spades4 of DiamondsKing of Diamonds10 of Hearts9 of Diamonds2 of Diamonds10 of Diamonds5 of Hearts10 of DiamondsQueen of DiamondsQueen of DiamondsQueen of Diamonds4 of Diamonds2 of Diamonds9 of DiamondsQueen of Diamonds10 of Diamonds7 of Hearts5 of Hearts8 of Clubs4 of Hearts5 of Hearts5 of Hearts5 of Hearts如您所见,钻石太多,而几乎没有梅花或黑桃。我也注意到只有西装是乱七八糟的。每个数字都有四个,四个千斤顶皇后,国王和 A。谢谢您的帮助。
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 173 浏览

添加回答

举报

0/150
提交
取消
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号