静态初始化块中的stream无法停止。。
把这段内容移动到main中就没有问题。jdk1.8.0_144,不用IDE用纯java命令也试过了。百撕不得骑姐。
public static void main(String[] args) { } static {
List<Integer> ints = Arrays.asList(1, 2, 3, 4, 5);
List<String> s = ints.parallelStream()
.map(i -> i.toString())
.collect(Collectors.toList()); System.out.println(s);
}
把这段内容移动到main中就没有问题。jdk1.8.0_144,不用IDE用纯java命令也试过了。百撕不得骑姐。
public static void main(String[] args) { } static {
List<Integer> ints = Arrays.asList(1, 2, 3, 4, 5);
List<String> s = ints.parallelStream()
.map(i -> i.toString())
.collect(Collectors.toList()); System.out.println(s);
}
stackoverflow还真是牛B呀。看来还记基础支持不行。居然不知道初始化死锁问题。
Exception: java.lang.OutOfMemoryError thrown from the UncaughtExceptionHandler in thread "main"
内存的问题 你发的帖子没看懂 我现在也遇到了这个问题能给我改下吗
qq1695873323收到请回复谢谢