Answer is B.
To test:
public static void main(String[] args) {
Predicate<Integer> p = (n) -> n % 2 == 0;
Boolean s = p.test(100); System.out.println(s); // Option B
}
The answer is the letter B, the lambda expression informs that the rest of the operation must be "== 0", that is, any even number will print true, so just invoke the method with an even number and assign it to a variable and print it right after, which is what is done in the letter B.
upvoted 1 times
...
Log in to ExamTopics
Sign in:
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.
Upvoting a comment with a selected answer will also increase the vote count towards that answer by one.
So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.
akbiyik
5 days, 1 hour agocarloswork
1 month, 2 weeks agoiSnover
2 months ago