Java Array Max Value maxElement(int[] array)

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

Description

max Element

License

Apache License

Declaration

public static int maxElement(int[] array) 

Method Source Code

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

public class Main {
    public static int maxElement(int[] array) {

        int result = Integer.MIN_VALUE;

        for (int element : array)
            result = Math.max(result, element);

        return result;
    }/*from   w  w  w  . j av a 2 s .  c  o  m*/

    public static double max(double[] array) {

        double result = -Double.MAX_VALUE;

        for (double element : array)
            result = Math.max(result, element);

        return result;
    }
}

Related

  1. maxdiffbits(int initoffset, int[] i, int pos, int length)
  2. maxDiffLocation(double[] list1, double[] list2)
  3. maxDistance(byte[] array, int maxDistance)
  4. maxDouble(double a, double... others)
  5. maxElement(double[] d)
  6. maxElementIndex(final double[] array)
  7. maxElementIndex(final double[] array)
  8. maxElementIndex(final double[] array, final int endIndex)
  9. maxFloorDiv(int c, int... vals)