Java IntStream count element
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 ww w .j av a2 s .c o m*/ System.out.printf("%nCount: %d%n",intStream.count()); } }