提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
生成随机值数组
//package com.nowjava;/** 来 自 n o w j a v a . c o m - 时代Java**/ public class Main { public static void main(String[] argv) throws Exception { int size = 2; int range = 2; System.out.println(java.util.Arrays.toString(genRandomMas(size, range))); } public static int[] genRandomMas(int size, int range) { int[] mas = new int[size]; for (int i = 0; i < mas.length; i++) {