Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;

public class Main {
    public static String[] populateStringArray(int numberOfItems) {
        final String partialWord = "partialArrayParallel";
        String[] dummyStringArray = null;
        if (numberOfItems > 0) {
            dummyStringArray = new String[numberOfItems];
            for (int i = 0; i < numberOfItems; i++) {
                final double randomNumber = (Math.random() * numberOfItems);
                final StringBuilder sb = new StringBuilder(partialWord).append(randomNumber);
                dummyStringArray[i] = sb.toString();
            }
        }
        return dummyStringArray;
    }
}