Java Array Min Value min(long[] arr)

Here you can find the source of min(long[] arr)

Description

min

License

Open Source License

Declaration

public static long min(long[] arr) 

Method Source Code

//package com.java2s;
//License from project: Open Source License 

public class Main {
    public static long min(long[] arr) {
        if (arr.length == 0)
            return 0;
        long ret = arr[0];
        for (int i = 1; i < arr.length; i++)
            if (arr[i] < ret)
                ret = arr[i];//from  ww  w  .j  av a2  s.c  o m
        return ret;
    }

    public static int min(int[] arr) {
        if (arr.length == 0)
            return 0;
        int ret = arr[0];
        for (int i = 1; i < arr.length; i++)
            if (arr[i] < ret)
                ret = arr[i];
        return ret;
    }
}

Related

  1. min(int[] values)
  2. min(int[] values)
  3. min(int[] vs)
  4. min(int[] x, int length)
  5. min(long first, long... rest)
  6. min(long[] array)
  7. min(long[] array)
  8. min(long[] array)
  9. min(Number... array)