/* TestGenerics3.java CIS 260 David Klick 1/28/2010 This program demonstrates how using a superclass, such as Object, enables something very similar to using Java generics. The superclass must have the methods that are assumed in the call to the sort-of genericized method. */ public class TestGenerics3 { public static void main(String[] args) { Integer[] nums = { 2, 4, 6, 8, 10 }; String[] names = { "Toby", "Rob", "Rebecca", "Matt", "Dave" }; displayArray(nums); displayArray(names); } private static void displayArray(Object[] a) { for (Object e : a) System.out.print(e + " "); System.out.println(); } }