Predicate

매개변수와 boolean 리턴값이 있는 testXXX() 메소드를 가지고 있다. 매개값을 조사해서 true 또는 false를 리턴하는 역할을 한다. public class PredicateExample { private static List numList = Arrays.asList(1, 2, 3, 4, 5, 6, 7, 8, 9, 10); public static int count(IntPredicate predicate){ int count = 0; for(int num : numList){ if(predicate.test(num)){ count ++; } } return count; } public static void main(String[] args) { int evenNumCount = coun..
깡냉쓰
'Predicate' 태그의 글 목록