????Java 8????????????????????????????????????????????????к??????????д???????????????У???????Java 8????????????????????Java 7??????8??????????????????Щ??
???????????????????
????Java 8???????????д??????????????????????????????????.parallelStream()?????????????????????????????????????????????????????????????????????CPU??????????????????????????Щ????????????fork/join?????????????????????????????????μ?????????????????????????????????????
?????????????????????????????????????????????????????????е?????????????????15%???????????п???????????????????????????????????????????????.parallelStream()??????????????????????С????????????????????????????????????????????л???????????????????
??????????????????????????????????????????????????????????????????????????
????Map<Boolean?? List<Integer>> groupByPrimary = numbers
????.parallelStream().collect(Collectors.groupingBy(s -> Utility.isPrime(s)));
???????б?????????????????????????????????????????????ж???????????????????????????????????????????????.parallelStream() ???з??????????????Щ???????????????????????Lukas Krecan????????£??????и?????Щ???????????
???????????д????????????????????????????????????????????????????????????????μ???????ū???????????????????????
????Lambda???????????
????Lambda????Lambda???????????????????????????????????????????????????????????????????????????????????????????????????????????????籭?????????????????????????
????List lengths = new ArrayList();
????for (String countries : Arrays.asList(args)) {
????lengths.add(check(country));
????}
???????????Lambda?????????ú???????
????Stream lengths = countries.stream().map(countries -> check(country));
??????????????????????????????£???????Lambda????????????????Java????????е????????????淶????????????????????????????????????????lambda???????????????????????????????????????Tal Weiss????????£??????????lambda???????Щ?????檔
??????????ζ??????д????????????????????????????????????????????????????????????????????
???????????????б?????????????????????????
????at LmbdaMain.check(LmbdaMain.java:19)
????at LmbdaMain.main(LmbdaMain.java:34)
?????????????

 

at LmbdaMain.check(LmbdaMain.java:19)
at LmbdaMain.lambda$0(LmbdaMain.java:37)
at LmbdaMain$$Lambda$1/821270929.apply(Unknown Source)
at java.util.stream.ReferencePipeline$3$1.accept(ReferencePipeline.java:193)
at java.util.Spliterators$ArraySpliterator.forEachRemaining(Spliterators.java:948)
at java.util.stream.AbstractPipeline.copyInto(AbstractPipeline.java:512)
at java.util.stream.AbstractPipeline.wrapAndCopyInto(AbstractPipeline.java:502)
at java.util.stream.ReduceOps$ReduceOp.evaluateSequential(ReduceOps.java:708)
at java.util.stream.AbstractPipeline.evaluate(AbstractPipeline.java:234)
at java.util.stream.LongPipeline.reduce(LongPipeline.java:438)
at java.util.stream.LongPipeline.sum(LongPipeline.java:396)
at java.util.stream.ReferencePipeline.count(ReferencePipeline.java:526)
at LmbdaMain.main(LmbdaMain.java:39)

????lambda?????????????????????????????lambda??????????????????????????????з??????????????????????ü???????????????μ??÷??????塣Lukas Eder??????????????????
??????????????????????????????????????????????赲???????lambda??????