int[] arr = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 10 };
int[] arr1 = new int[3];
int sum = 0;
Random r = new Random();
for (int i = 0; i < 3; i++) {
arr = arr[r.nextInt(arr.length)];
sum++;
}
System.out.println();
欢迎光临 黑马程序员技术交流社区 (http://bbs.itheima.com/) | 黑马程序员IT技术论坛 X3.2 |