//package com.nowjava;
public class Main {/*来 自 n o w j a v a . c o m*/
public static void main(String[] argv) throws Exception {
double[] value = new double[] { 34.45, 35.45, 36.67, 37.78,
37.0000, 37.1234, 67.2344, 68.34534, 69.87700 };
System.out.println(maxIndex(value));
}
/**
* returns the index of the greatest element from the given array
*/
public static double maxIndex(double[] value) {
double result = Double.NEGATIVE_INFINITY;
int index = 0;
for (int i = 0; i < value.length; i++) {
if (value[i] > result)
/**
from
/**代码未完, 请加载全部代码(NowJava.com).**/
本文系作者在时代Java发表,未经许可,不得转载。如有侵权,请联系nowjava@qq.com删除。