A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://docs.oracle.com/en/java/javase/20/docs/api/java.base/java/util/stream/IntStream.html below:

IntStream (Java SE 20 & JDK 20)

All Superinterfaces:
AutoCloseable, BaseStream<Integer,IntStream>

A sequence of primitive int-valued elements supporting sequential and parallel aggregate operations. This is the

int

primitive specialization of

Stream

.

The following example illustrates an aggregate operation using Stream and IntStream, computing the sum of the weights of the red widgets:


     int sum = widgets.stream()
                      .filter(w -> w.getColor() == RED)
                      .mapToInt(w -> w.getWeight())
                      .sum();
 

See the class documentation for

Stream

and the package documentation for

java.util.stream

for additional specification of streams, stream operations, stream pipelines, and parallelism.

Since:
1.8
See Also:

RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4