Here you can find the source of findMax(double[] values)
Parameter | Description |
---|---|
values | the array of values from which the highest one is to be found |
public static int findMax(double[] values)
//package com.java2s; public class Main { /**//from w w w. j a v a2s . com * Return the index of the maximum value found in the array. * @param values the array of values from which the highest one is to be found * @return the index of the highest value */ public static int findMax(double[] values) { int maxIdx = 0; for (int i = 0; i < values.length; ++i) { if (values[i] > values[maxIdx]) { maxIdx = i; } } return maxIdx; } }