Java examples for XML:DOM Element
get Max Element Position in double array
//package com.java2s; public class Main { public static int getMaxElementPosition(double[] data) { int pos = 0; double tmp = 0.0; for (int i = 0; i < data.length; i++) { pos = tmp > data[i] ? pos : i; tmp = tmp > data[i] ? tmp : data[i]; }/*from w w w. j a v a 2 s. co m*/ return pos; } }