Here you can find the source of max(int[] array)
public static int max(int[] array)
//package com.java2s; //License from project: Apache License import java.util.ArrayList; public class Main { public static int max(int[] array) { int max = -Integer.MAX_VALUE; for (int a : array) { if (a > max) { max = a;//from ww w. ja v a2s . c o m } } return max; } public static double max(double[] array) { double max = -Double.MAX_VALUE; for (double a : array) { if (a > max) { max = a; } } return max; } public static double max(ArrayList<Double> array) { double max = -Double.MAX_VALUE; for (double a : array) { if (a > max) { max = a; } } return max; } }