Java Array Max Value findMaxIndex(final int[] array)

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

Description

find Max Index

License

Apache License

Declaration

public static int findMaxIndex(final int[] array) 

Method Source Code

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

public class Main {
    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;//  w w  w .ja v  a  2s  .c om
            }
        }

        return maxIndex;
    }
}

Related

  1. findMax2(int[] workArray, int idx, int max)
  2. findMaxAbs(float[] array)
  3. findMaxCommonPrefix(String path1, String path2)
  4. findMaxDiff(byte[] rand, byte[] newRand)
  5. findMaximumUnitFor(long elapsed, int specifiedMax)
  6. findMaxIndex(int[] a)
  7. findMaxIndex(int[] arr)
  8. findMaxOverlap(final int[] overlapRange, final int[] outputRange, final int[] min, final int[] max)
  9. findMaxValue(int[] array)