static int max (List<int> a) { int m = a[0]; for (int i = 1; i < a.length; ++i) { if (a[i] > m){ m = a[i]; } } return m; }