Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

//package com.java2s;
import java.util.ArrayList;
import java.util.List;

public class Main {
    public static List<Double> populateDoubleList(int numberOfItems) {
        List<Double> dummyDoubleList = null;
        if (numberOfItems > 0) {
            dummyDoubleList = new ArrayList<Double>();
            for (int i = 0; i < numberOfItems; i++) {
                final double randomNumber = (Math.random() * numberOfItems);
                dummyDoubleList.add(randomNumber);
            }
        }
        return dummyDoubleList;
    }
}