forEach abstract method

void forEach(
  1. void action(
    1. int
    )
)

Performs the given action for each element of the stream.

Example

IntStream.range(1, 5)
    .forEach(print); // prints 1, 2, 3, 4

Implementation

void forEach(void Function(int) action);