public static long countOccurrences(int[] numbers, int value) { return Arrays.stream(numbers) .filter(number -> number == value) .count(); }
原文地址:https://www.cnblogs.com/R4mble/p/8407970.html
时间: 2024-10-04 23:14:44
public static long countOccurrences(int[] numbers, int value) { return Arrays.stream(numbers) .filter(number -> number == value) .count(); }
原文地址:https://www.cnblogs.com/R4mble/p/8407970.html