提示:您可在线编辑运行本教程的实例 - 运行实例,去试试!
用随机双值填充双数组
//package com.nowjava; /* NowJava.com - 时代Java 提 供 */ public class Main { public static void main(String[] argv) { int numberOfItems = 42; System.out.println(java.util.Arrays .toString(populateDoubleArray(numberOfItems))); } public static Double[] populateDoubleArray(int numberOfItems) { final String partialWord = "partialArrayParallel"; Double[] dummyDoubleArray = null; if (numberOfItems > 0) { dummyDoubleArray = new Double[numberOfItems]; for (int i = 0; i < numberOfItems; i++) { final double randomNumber = (Math.rando