Main.java Source code

Java tutorial

Introduction

Here is the source code for Main.java

Source

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

public class Main {
    public static double getMindouble(double[] arr) {
        double min = Double.MAX_VALUE;

        for (int i = 0; i < arr.length; i++) {

            if (arr[i] < min)
                min = arr[i];
        }

        return min;
    }

    public static double getMindouble(ArrayList<Double> arr) {
        double min = Double.MAX_VALUE;

        for (int i = 0; i < arr.size(); i++) {
            double d = arr.get(i);
            if (d < min)
                min = d;
        }

        return min;
    }
}