Java IntStream get max value

Description

Java IntStream get max value


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);
    System.out.printf("Max: %d%n", intStream.max().getAsInt());

  }/*from  w  ww .j  a  v  a 2  s.c  o m*/
}



PreviousNext

Related