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

Which two are valid statements? (Choose two.)

    Correct Answer: B, C

    A valid statement for a BiPredicate must have consistent parameter declarations according to the lambda syntax rules. Option (B) is correct because it declares both parameters with specific types, which is valid. Option (C) is also correct because it uses 'var' for both parameters, a permissible combination in lambda expressions. Other combinations mix 'var' with explicit types or don't follow valid patterns for lambda parameter declarations.

Discussion
cathDev

Tested Only C is correct

ASPushkinOption: C

answer : C B is not correct BiPredicate test = (Integer x, final Integer y) -> (x.equals(y)); BiPredicate - raw type same as BiPredicate<Object, Object> BiPredicate<Object, Object> is not a subclass of BiPredicate<Integer, Integer> but BiPredicate test = (var x, var y) = x.equals(y); is correct

d7bb0b2Options: BC

ARE CORRECT

ASPushkin

almost same as 22

ASPushkin

see 221 (same)