我正在编写简单的程序,它最终将绘制用Java编写的各种排序算法的运行时间。排序算法的通用接口是通过一种方法:public void sort(Comparable[] xs)。
我试图使用Java 8的流机制生成随机测试用例,大致如下:
public static IntStream testCase(int min, int max, int n) {
Random generator = new Random();
return generator.ints(min, max).limit(n);
}我的问题是,如何将IntStream类型的对象转换为Integer[]
https://stackoverflow.com/questions/35461131
复制相似问题