Here you can find the source of max(int[] a)
public static int max(int[] a)
//package com.java2s; /* @(#)ArrayUtil.java// w w w. j a v a 2s . c o m * * Copyright (c) 2003 Werner Randelshofer, Switzerland. MIT License. * * Implementation derived from Sun's Java 1.4 VM. */ public class Main { /** * Returns the biggest integer value of the array. */ public static int max(int[] a) { int v = Integer.MIN_VALUE; for (int i = a.length - 1; i != -1; i--) { if (a[i] > v) v = a[i]; } return v; } }