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[]) { int max = 0; for (int elemento : array) if (elemento > max) max = elemento;//from w ww.j a va2s . c o m return max; } }