Example usage for java.util.stream IntStream forEachOrdered

List of usage examples for java.util.stream IntStream forEachOrdered

Introduction

In this page you can find the example usage for java.util.stream IntStream forEachOrdered.

Prototype

void forEachOrdered(IntConsumer action);

Source Link

Document

Performs an action for each element of this stream, guaranteeing that each element is processed in encounter order for streams that have a defined encounter order.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntStream i = IntStream.of(1, 2, 3, 4);
    i.forEachOrdered(System.out::println);
}