diff --git a/src/senior/Lambda/Collection.kt b/src/senior/Lambda/Collection.kt index 76d80e4..27becfa 100644 --- a/src/senior/Lambda/Collection.kt +++ b/src/senior/Lambda/Collection.kt @@ -30,4 +30,8 @@ fun main(args: Array) { // 查找所有满足条件的元素 println("element > 10 = ${list.filter { it >= 20 }}") + // 统计满足条件的元素个数 + println("element num > 10 = ${list.count { it >= 20 }}") + + } \ No newline at end of file