java.util.stream.IntStream in Java 8, deals with primitive ints. It helps to solve the old problems like finding maximum value in array, finding minimum value in array, sum of all elements in array, and average of all values in array in a new way. IntStream min() returns an OptionalInt describing the minimum element of this stream, or an empty optional if this stream is empty.
Where, OptionalInt is a container object which
may or may not contain a int value.
Below given are some examples to understand the function in a better way. Example 1 :
Please Login to comment...