Here you can find the source of max(int[] values)
public static int max(int[] values)
//package com.java2s; public class Main { public static int max(int[] values) { int max = Integer.MIN_VALUE; for (int i = 0; i < values.length; i++) { if (values[i] > max) { max = values[i];//from w ww . jav a 2 s . c o m } } return max; } public static int max(int[][] values) { int max = Integer.MIN_VALUE; for (int i = 0; i < values.length; i++) { for (int j = 0; j < values[i].length; j++) { if (values[i][j] > max) { max = values[i][j]; } } } return max; } }