Fill in the blanks:
In the Collection interface, the method removeIf()
takes a ___, while the method forEach()
takes a ___.
B.
The removeIf()
method requires a Predicate since it operates on a boolean result, making Option A incorrect.
The forEach()
method takes a Consumer and does not return any data, making Option B correct, and Options C and D incorrect.