We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Stream<String> stream = Stream.of("I", "love", "you", "too"); List<String> list = stream.collect(ArrayList::new,ArrayList::add,(t,u)-> { System.out.println("t:" + t+" u:" + u); t.addAll(u); }); System.out.println(list);
谢谢, 你启发(正反参半)了我.
这个例子,collect的第三个参数并没有执行,若能举一个体现第三个参数作用的例子会更好.
The text was updated successfully, but these errors were encountered:
Stream stream = Stream.of("I", "love", "you", "too").parallel();换成并行流时候,第三个参数会起作用
Sorry, something went wrong.
@xixifeng 第三个是merge函数,在Stream并发时会对输入做切分,分别执行中间的过程,最后合并结果,这个时候就有效果了。
No branches or pull requests
谢谢, 你启发(正反参半)了我.
这个例子,collect的第三个参数并没有执行,若能举一个体现第三个参数作用的例子会更好.
The text was updated successfully, but these errors were encountered: