Here you can find the source of max(int[] arr)
static public int max(int[] arr)
//package com.java2s; import java.util.ArrayList; public class Main { static public int max(int[] arr) { int max = Integer.MIN_VALUE; for (int i : arr) max = Math.max(max, i); return max; }//from www. ja va 2 s . co m static public int max(ArrayList<Integer> arrlist) { int max = Integer.MIN_VALUE; for (int i : arrlist) max = Math.max(max, i); return max; } static public double max(double[] arr) { double max = Double.MIN_VALUE; for (double x : arr) max = Math.max(max, x); return max; } }