Java Array Max Value findMaxValue(int[] array)

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

Description

find Max Value

License

Apache License

Declaration

public static int findMaxValue(int[] array) 

Method Source Code

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

public class Main {
    public static int findMaxValue(int[] array) {
        return array[findMaxIndex(array)];
    }/*from   ww w  .  j a  va2 s .  co  m*/

    public static int findMaxIndex(final int[] array) {
        int maxIndex = 0;

        for (int i = 1; i < array.length; i++) {
            if (array[maxIndex] < array[i]) {
                maxIndex = i;
            }
        }

        return maxIndex;
    }
}

Related

  1. findMaximumUnitFor(long elapsed, int specifiedMax)
  2. findMaxIndex(final int[] array)
  3. findMaxIndex(int[] a)
  4. findMaxIndex(int[] arr)
  5. findMaxOverlap(final int[] overlapRange, final int[] outputRange, final int[] min, final int[] max)
  6. findMaxValueIndex(double[] d)
  7. max(boolean useInt, int... value)
  8. max(byte[] arr)
  9. max(byte[] array)