(String[] args)
| 9 | public 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: |
| 25 | 258 555 693 861 961 429 868 200 522 207 288 128 551 589 |