Topic: 1z0-809 topic 1 question 110
Given:
and
Which interface from the java.util.function package should you use to refactor the class Txt?
A.
Consumer
B.
Predicate
C.
Supplier
D.
Function
IT Certification exam information exchange, brain dumps discussions sharing.
You are not logged in. Please login or register.
Share Test → VCE Exam Simulator → 1z0-809 topic 1 question 110
Given:
and
Which interface from the java.util.function package should you use to refactor the class Txt?
A.
Consumer
B.
Predicate
C.
Supplier
D.
Function
B is correct. predicate accepts one parameter and returns boolean value
B, return is boolean, and takes 1 argument...
It is predicate, we can replace the annoymous local class with a Predicate implementation:
Predicate<String> checkLength = str -> str.length()>5 && str.length()<10;
boolean res = checkLength("Hello");
B is the correct answer
B is correct as Predicate accepts one argument and returns boolean.
B because predicates return a boolean value
Share Test → VCE Exam Simulator → 1z0-809 topic 1 question 110
Note: This forum is a platform for users to share insights and discuss exam-related topics. We do not provide authentic exam questions or answers. The content here is contributed by community members and is meant for collaborative learning and discussion purposes only. Users are encouraged to refer to official sources for accurate exam materials.