Here you can find the source of max(int[] x, int length)
public static int max(int[] x, int length)
//package com.java2s; //License from project: BSD License public class Main { public static int max(int[] x, int length) { int m = Integer.MIN_VALUE; for (int i = 0; i < length; i++) if (x[i] > m) m = x[i];//from w w w .j a va 2s . co m return m; } public static int max(int[] x) { return max(x, x.length); } public static double max(double[] x, int length) { double m = Double.NEGATIVE_INFINITY; for (int i = 0; i < length; i++) if (x[i] > m) m = x[i]; return m; } }