Here you can find the source of maxIndex(int[] array)
public static int maxIndex(int[] array)
//package com.java2s; //License from project: Apache License public class Main { /**//from w ww.java 2 s .c o m * @return the maximum index in this array, */ public static int maxIndex(int[] array) { int maxIndex = 0; for (int i = 0; i < array.length; i++) { if (array[maxIndex] < array[i]) { maxIndex = i; } } return maxIndex; } /** * @return the maximum index in this array, */ public static int maxIndex(long[] array) { int maxIndex = 0; for (int i = 0; i < array.length; i++) { if (array[maxIndex] < array[i]) { maxIndex = i; } } return maxIndex; } /** * @return the maximum index in this array, */ public static int maxIndex(double[] array) { int maxIndex = 0; for (int i = 0; i < array.length; i++) { if (array[maxIndex] < array[i]) { maxIndex = i; } } return maxIndex; } }