import java.util.Arrays; public class Demo { public static void main(String[] args) { int[] arr = new int[10]; for (int i=0; i < arr.length; i++) { arr[i] = (int) (Math.random() * 100); } System.out.println(Arrays.toString(arr)); } }
运行结果:
[48, 31, 63, 67, 77, 80, 58, 52, 47, 61]