Delegates & events · interview question
Name a built-in generic delegate type for a method that takes an int and returns a bool.
Fill in the blankMedium
Answer and explanation
Correct answer
Func<int, bool> or Func<int,bool> or Predicate<int>
Why
Func<int, bool> (the last type argument is the return type) or Predicate<int>. LINQ uses Func<T, bool>, while List<T>.FindAll takes Predicate<T>.
Test yourself on Delegates & events
A free test with instant, explained results. No account needed.