public class GenericArray { public static void main(String args[]) { String str[] ={"呵","呵呵","呵呵呵"}; tell(str); } public static <T> void tell(T arr[]) { for (int i = 0; i < arr.length; i++) { System.out.println(arr[i]); } } }
原文:http://www.cnblogs.com/sflik/p/4544762.html