标签:
String[] beforeShuffle = new String[] {"1", "2", "3", "4", "5", "6", "7",
"8", "9","10"
};
List list = Arrays.asList(beforeShuffle);
Collections.shuffle(list);
StringBuilder sb = new StringBuilder();
for (int i = 0; i < list.size(); i++) {
sb.append(list.get(i));
}
String afterShuffle = sb.toString();
String bianhao = afterShuffle.substring(3, 9);
比较简单,用着方便
标签:
原文地址:http://www.cnblogs.com/yuxiliang/p/5799478.html