public class Demo_8 {
// 产生10个随机数放到数组中
public static void main(String[] args) {
int[] arr = new int[10];
Random random = new Random();
for (int i = 0; i < arr.length; i++) {
// int s = random.nextInt(100) + 1;
arr[i] = random.nextInt(100) + 1;
System.out.println(Arrays.toString(arr));
}
}
}
|
|