Fill in the blank so this code prints 8.0. Note that it must not print OptionalDouble[8.0].
LongStream stream = LongStream.of(6, 10); LongSummaryStatistics stats = stream.summaryStatistics(); System.out.println(___);
avg()
average()
average()
.get()
getAverage()
D.
The summary statistics classes provide getters in order to access the data.
The getAverage()
method returns a double and not an OptionalDouble.
Option D is the only option to compile.