会员
众包
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式
...
退出登录
注册
登录
kuku
学习笔记
博客园
首页
新随笔
联系
订阅
管理
2007年11月20日
从一个数组中随机获取一些并不重复的数据
摘要: 以前都是使用以下代码来实现这种功能的:int[] array1 = {1,2,3,4,5,6,7,8,9,0};int[] array2 = new int[5];int i = 0;while(i < array2.length){ int index = (int)Math.random() * array1.length; int value = array1[index]; if(...
阅读全文
posted @ 2007-11-20 20:11 匡匡
阅读(477)
评论(0)
推荐(0)
编辑
公告