// GMDemo.java import java.util.*; class GMDemo { public static void main (String [] args) { String [] names = { "George", "Jane", "Joel" }; List l = new ArrayList(); fromArrayToCollection (names, l); printCollection (l); List l2 = new ArrayList(); fromArrayToCollection2 (names, l2); printCollection2 (l2); } static void fromArrayToCollection (Object [] a, Collection c) { for (Object o: a) c.add (o); } static void fromArrayToCollection2 (T [] a, Collection c) { for (T o: a) c.add (o); } static void printCollection (Collection c) { for (Object e: c) System.out.println (e); } static void printCollection2 (Collection c) { for (Object e: c) System.out.println (e); } }