mirror of
https://gitflic.ru/project/openide/openide.git
synced 2026-05-01 18:58:31 +07:00
12 lines
333 B
Java
12 lines
333 B
Java
// "Collapse loop with stream 'toArray()'" "true-preview"
|
|
|
|
import java.util.Arrays;
|
|
import java.util.stream.IntStream;
|
|
|
|
public class Test {
|
|
public void test(int bound) {
|
|
Integer[][] arr = IntStream.range(0, bound).mapToObj(i -> new Integer[]{i}).toArray(Integer[][]::new);
|
|
System.out.println(Arrays.toString(arr));
|
|
}
|
|
}
|