泛型数组
package generic;
public class GenericDemo005 {
public static <T> void order(T[] arr) {
T[] arrs = (T[]) new Object[arr.length];
arrs = arr;
for (T s : arrs) {
System.out.println(s);
}
}
public static void main(String[] args) {
GenericDemo005 gc = new GenericDemo005();
String[] arrs = {"bbbb", "AAA"};
order(arrs);
Integer[] arr = {13, 15};
order(arr);
}
}