Here you can find the source of maxElement(int[] array)
public static int maxElement(int[] array)
//package com.java2s; //License from project: Apache License public class Main { public static int maxElement(int[] array) { int result = Integer.MIN_VALUE; for (int element : array) result = Math.max(result, element); return result; }/*from w w w . j av a 2 s . c o m*/ public static double max(double[] array) { double result = -Double.MAX_VALUE; for (double element : array) result = Math.max(result, element); return result; } }