Here you can find the source of max(int[] array)
public static int max(int[] array)
//package com.java2s; //License from project: Apache License public class Main { /**//from w w w .jav a2 s. c o m * @return the maximum value in this array, */ public static int max(int[] array) { int maxValue = array[0]; for (int aVector : array) { if (maxValue < aVector) { maxValue = aVector; } } return maxValue; } /** * @return the maximum value in this array, */ public static long max(long[] array) { long maxValue = array[0]; for (long aVector : array) { if (maxValue < aVector) { maxValue = aVector; } } return maxValue; } /** * @return the maximum value in this array, */ public static double max(double[] array) { double maxValue = array[0]; for (double aVector : array) { if (maxValue < aVector) { maxValue = aVector; } } return maxValue; } }