SE450: Wildcards [65/86] |
public static <E extends Comparable<E>> E getMax(ArrayList<E> a)
{
E max = a.get(0);
for (int i = 1; i < a.size(); i++)
if (a.get(i).compareTo(max) > 0) max = a.get(i);
return max;
}
public static <E extends Comparable<? super E>> E getMax(ArrayList<E> a)