MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

streams/ForEach.java:11–22  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

9public class ForEach {
10 static final int SZ = 14;
11 public static void main(String[] args) {
12 rands().limit(SZ)
13 .forEach(n -> System.out.format("%d ", n));
14 System.out.println();
15 rands().limit(SZ)
16 .parallel()
17 .forEach(n -> System.out.format("%d ", n));
18 System.out.println();
19 rands().limit(SZ)
20 .parallel()
21 .forEachOrdered(n -> System.out.format("%d ", n));
22 }
23}
24/* Output:
25258 555 693 861 961 429 868 200 522 207 288 128 551 589

Callers

nothing calls this directly

Calls 2

randsMethod · 0.80
formatMethod · 0.45

Tested by

no test coverage detected