What is the output of the following?
1: package mypkg; 2: import java.util.stream.*; 3: 4: public class Main { 5: public static void main(String[] args) { 6: IntegerStream pages = IntegerStream.of(200, 300); 7: IntegerSummaryStatistics stats = pages.summaryStatistics(); 8: long total = stats.getSum(); 9: long count = stats.getCount(); 10: System.out.println(total + "-" + count); 11: }// ww w.j a v a2s .c om 12: }
C.
For the primitive stream that contains the int primitives, the interface names are incorrect.
They should be IntStream and IntSummaryStatistics, making Option C correct.
If this was fixed, Option B would be the answer.