Java IntStream create from int array

Description

Java IntStream create from int array

import java.util.stream.IntStream;

public class Main {
  public static void main(String[] args) {
    int[] values = { 1, 2, 3, 4, 5, 6, 7, 8, 9, 0};

    IntStream intStream = IntStream.of(values);
    /*from  w  w w.j a  v a 2 s  .c o m*/
    intStream.forEach(value -> System.out.printf("%d ", value));
    System.out.println();

  }
}



PreviousNext

Related