Here you can find the source of Max(ArrayList
public static int Max(ArrayList<ArrayList<Integer>> data)
//package com.java2s; //License from project: Open Source License import java.util.ArrayList; import java.util.Collection; public class Main { public static int Max(Collection<Integer> a) { int i = 0; for (int z : a) i = Math.max(i, z);/*from w ww.j a v a2 s. co m*/ return i; } public static int Max(ArrayList<ArrayList<Integer>> data) { int c = 0; for (int i = 0; i < data.size(); i++) c = Math.max(c, Max(data.get(i))); return c; } }