Java 将整数数组传递给使用元素的泛型数组的方法?

Java 将整数数组传递给使用元素的泛型数组的方法?,java,generics,Java,Generics,我有以下课程 public class TestAlgorithm<E extends Comparable<? super E>> { public void testing(E[] array) { for(int i = 0; i<= array.length; i++) { ... // processing code (not important here) }

我有以下课程

public class TestAlgorithm<E extends Comparable<? super E>> 
{
    public void testing(E[] array)
    {
        for(int i = 0; i<= array.length; i++)
        {
            ... // processing code (not important here)
        }
    }
}

public class TestAlgorithm您将
myAlgo
定义为
Integer
类型,但您正在调用
int
的向量。使用
整数
向量:

Integer[] test = {3,7,8,5,2,1,9,5,4};

我觉得自己像个白痴。谢谢
Integer[] test = {3,7,8,5,2,1,9,5,4};