我有这段我想调试的流代码。我运行Debug模式,单击Debug工具窗口中的跟踪当前流链按钮,然后打开Stream跟踪窗口,尽管我有一个内部错误,而不是评估结果。
(社区版2020.3)
公共类Main {
public static void main(String... args) throws IOException {
String input = "Speedment";
String result = Stream.of(input.split(""))
.map(s -> s.charAt(0))
.sorted()
.limit(5)
.map(String::valueOf)
.collect(joining());
System.out.println(result);
}}
发布于 2022-07-08 11:30:37
我按了平模式按钮,它就能工作了!
究其原因,是因为流中操作太多,笔记本内存不足。
https://stackoverflow.com/questions/72910051
复制相似问题