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]); } } }
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]); } } }