public class Test1 { public static void main(String[] args) { int[] a = suiJi(); System.out.println(Arrays.toString(a)); sort(a); System.out.println(Arrays.toString(a)); }
private static int[] suiJi() { int n = 5 + new Random().nextInt(6); int[] a = new int[n]; for (int i = 0; i < a.length; i++) { a[i] = new Random().nextInt(100); } return a; }