Java tutorial
//package com.java2s; //License from project: Open Source License public class Main { /************************************* * data type conversion **************************************/ public static int idxOfMax(double[] values) { int ret = -1; double max = Double.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (values[i] > max) { max = values[i]; ret = i; } } return ret; } }