public static Comparable min(Comparable[] a) { Comparable smallest = a[0]; for (int i = 1; i < a.length; i++) if (a[i].compareTo(smallest) < 0) smallest = a[i]; return smallest; }
Knowing about raw types helps you understand limitations of Java
generics
For example, you cannot replace type variables with primitive
types
To interface with legacy code, you can convert between generic
and raw types