Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/327.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java 将整数数组传递给使用元素的泛型数组的方法?_Java_Generics - Fatal编程技术网

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