Here you can find the source of maxElement(double[] d)
public static double maxElement(double[] d)
//package com.java2s; //License from project: Open Source License public class Main { public static double maxElement(double[] d) { if (d.length == 0) throw new IllegalArgumentException("length cannot be 0."); double maxValue = d[0]; for (int i = 1; i < d.length; i++) { if (d[i] > maxValue) maxValue = d[i];//from ww w. j a v a 2s. c o m } return maxValue; } }