Here you can find the source of maxIdx(int[] in)
public static final int maxIdx(int[] in)
//package com.java2s; //License from project: Apache License public class Main { public static final int maxIdx(int[] in) { int out = in[0]; for (int i = 1; i < in.length; i++) { if (in[i] > in[out]) { out = i;// w ww. j av a 2 s .c o m } } return out; } public static final int maxIdx(double[] in) { int out = 0; for (int i = 1; i < in.length; i++) { if (in[i] > in[out]) { out = i; } } return out; } public static final int maxIdx(float[] in) { int out = 0; for (int i = 1; i < in.length; i++) { if (in[i] > in[out]) { out = i; } } return out; } }