Exam 1z0-819 All QuestionsBrowse all questions from this exam
Question 175

Given:

Which statement on line 1 enables the Test class to compile?

    Correct Answer: A

    To enable the Test class to compile successfully, the proper method associated with the Predicate functional interface must be used on line 1. The Predicate interface represents a single-argument function that returns a boolean value. The correct method in Predicate is `test`, which takes an argument and returns `true` or `false`. Hence, the statement `if(p.test(number)) {` would correctly fulfill this purpose, ensuring that the code compiles as intended.

Discussion
OmnisumemOption: A

Tested: A.

d7bb0b2Option: A

A is correct, predicated has method test other options are other funcrtional interface methods

StavokOption: A

A is correct TESTED