June 2017
Beginner
1296 pages
69h 23m
English
... NoSuchElementException. As with OptionalInt, to prevent this exception, you can instead call method orElse, which returns the OptionalDouble’s value if there is one, or the value you pass to orElse, otherwise.
Class IntStream also provides method summaryStatistics that performs the count, min, max, sum and average operations in one pass of an IntStream’s elements and returns the results as an IntSummaryStatistics object (package java.util). This provides a significant performance boost over reprocessing an IntStream repeatedly for each individual operation. This object has methods for obtaining each result and a toString method that summarizes all the results. For example, the statement:
System.out.println(IntStream.of(values).summaryStatistics());
produces: ...
Read now
Unlock full access