Java Array Min Value min(int[] array)

Here you can find the source of min(int[] array)

Description

min

License

Apache License

Return

the min value in this array,

Declaration

public static int min(int[] array) 

Method Source Code

//package com.java2s;
//License from project: Apache License 

public class Main {
    /**/*from   w ww . j av  a 2 s .c o  m*/
     * @return the min value in this array,
     */
    public static int min(int[] array) {
        int minValue = array[0];
        for (int aVector : array) {
            if (minValue > aVector) {
                minValue = aVector;
            }
        }
        return minValue;
    }

    /**
     * @return the minimum value in this array,
     */
    public static long min(long[] array) {
        long minValue = array[0];
        for (long aVector : array) {
            if (minValue > aVector) {
                minValue = aVector;
            }
        }
        return minValue;
    }

    /**
     * @return the minimum value in this array,
     */
    public static double min(double[] array) {
        double minValue = array[0];
        for (double aVector : array) {
            if (minValue > aVector) {
                minValue = aVector;
            }
        }
        return minValue;
    }
}

Related

  1. min(int[] arr)
  2. min(int[] arr)
  3. min(int[] arr, int count)
  4. min(int[] array)
  5. min(int[] array)
  6. min(int[] array)
  7. min(int[] array)
  8. min(int[] elements)
  9. min(int[] in, int x1, int x2)