Example usage for java.util.stream IntStream count

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

Introduction

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

Prototype

long count();

Source Link

Document

Returns the count of elements in this stream.

Usage

From source file:Main.java

public static void main(String[] args) {
    IntStream i = IntStream.empty();
    System.out.println(i.count());
}

From source file:Main.java

public static void main(String[] args) {
    IntStream i = IntStream.of(6, 5, 7, 1, 2, 3, 3);
    long d = i.count();
    System.out.println(d);//from  w w  w  .j a v a  2  s  . co  m
}