Here you can find the source of max(int[] array)
public static int max(int[] array)
//package com.java2s; //License from project: Open Source License public class Main { public static int max(int[] array) { if (array.length == 0) { throw new RuntimeException("Array is empty."); }/*from w w w.j a va 2s . co m*/ int max = array[0]; for (int i = 0; i < array.length; i++) { if (array[i] > max) { max = array[i]; } } return max; } }