Java开发网 |
注册 |
登录 |
帮助 |
搜索 |
排行榜 |
发帖统计
|
您没有登录 |
» Java开发网 » Java SE 综合讨论区
» 编程/算法/API
打印话题 寄给朋友 订阅主题 |
作者 | Re:楼上的太烦了,搞个简单的 [Re:toupeen] |
liushuiboy
发贴: 5 积分: 0 |
于 2007-01-24 12:41
public enum EnumPuke { heiTao,hongTao,fangkuai,meiHua; String[]point={"A","2","3","4","5","6","7","8","9","10","J","Q","K"}; } import java.util.*; public class AcessPuke { public static void main(String[] args) { // TODO Auto-generated method stub List<String> list = new ArrayList<String>(); String[] colors = { "黑桃", "红桃", "方块", "梅花" }; for (EnumPuke puke : EnumPuke.values()) { for (String str : puke.point) { list.add(colors[puke.ordinal()] + str); } } System.out.println(list); Collections.shuffle(list); System.out.println(list); } } 致JAVA初学者+如何下手学JAVA |
话题树型展开 |
已读帖子 新的帖子 被删除的帖子 |
Powered by Jute Powerful Forum® Version Jute 1.5.6 Ent Copyright © 2002-2021 Cjsdn Team. All Righits Reserved. 闽ICP备05005120号-1 客服电话 18559299278 客服信箱 714923@qq.com 客服QQ 714923 |