Java / Ope / Collection操作 / Stream / 終端処理 / counting

Java / Ope / Collection操作 / Stream / 終端処理 / counting

要素数を返す

List<Double> dList = new ArrayList<>();
dList.add(10.0);
dList.add(20.0);
dList.add(30.0);
 
//=> 3        
System.out.println(dList.stream().collect(Collectors.counting()));
java/ope/collection_ope/stream/tarminator/counting.txt · 最終更新: 2020-12-30 18:41 by ore