From 0ed2246708cec05475812e3a3a5d31895fc1c912 Mon Sep 17 00:00:00 2001 From: Julian Krieger Date: Wed, 15 May 2019 04:27:50 +0200 Subject: [PATCH] Nearer specified collect function (#32430) Added an example to specify how collecting works --- guide/english/java/streams/index.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/guide/english/java/streams/index.md b/guide/english/java/streams/index.md index 8efc04c08a..25cfd328fd 100644 --- a/guide/english/java/streams/index.md +++ b/guide/english/java/streams/index.md @@ -3,7 +3,7 @@ title: Streams --- # Streams -In Java 8 Streams got added as a new feature the Java toolbox. Streams allow you to quickly and cleanly process Collections. +In Java 8 Streams were added as a new feature the Java toolbox. Streams allow you to quickly and cleanly process Collections. Many functions of the Stream API allow for the use of Lambda expressions, which makes working with Streams an even more fluent process. Please read the chapter about lambdas and functional programming before continuing. @@ -27,7 +27,7 @@ These operations convert the Stream Objects somehow. ### Terminal Operations These operations receive the Stream Objects and end the Stream. -- `Stream.collect(Collector collector)`: collect all Objects in Stream into Object +- `Stream.collect(Collector collector)`: collect all Objects in Stream with the specified Function. (for example java.util.stream.Collectors.toList) - `Stream.forEach(Consumer consumer)`: consume all Objects in Stream using the consumer function - `Stream.count()`: count all Objects in Stream - `Stream.findFirst()`: return the first Object of the Stream and stop