利用Random类生成一个 1到30 之间的整数数组 不包括0 private static Random random = new Random(); public static int[] creat(int len){ int data[] = new int[len]; int foot = 0 ; while (foot < len){ int num = random.nextInt(30) if(num != 0){ data[foot++] = num; } } }