自定义泛型调用出错什么意思?
public class Demo1 { public <T> void swap(T arr[], int pos1, int pos2) { T temp = arr[pos1]; arr[pos1] = arr[pos2]; arr[pos2] = temp; }}
public class TestDemo { @Test public void test1() { int intArr[] = new int[] { 12, 13, 15, 14 }; Demo1 d = new Demo1(); d.swap(intArr, 1, 2); }}