1z0-819 Exam QuestionsBrowse all questions from this exam

1z0-819 Exam - Question 22


Which two are valid statements? (Choose two.)

Show Answer
Correct Answer: B,C,E

The valid statements involve parameters where the combination of data types and usage of the 'var' keyword are consistent with Java's rules for lambda parameter types. Statement (B) correctly uses 'var' for both parameters, and 'final' can be applied to 'var' parameters. Statement (E) uses explicitly typed parameters with 'final' as well, which is also valid in Java. Invalid statements either mix 'var' with explicitly typed parameters or omit necessary type declarations.

Discussion

9 comments
Sign in to comment
Leksh_geethOptions: BE
Nov 8, 2022

Correct answer is BE

RP384Options: BE
Jan 25, 2023

B and E are correct

JGR_77Options: BE
Mar 28, 2023

BiPredicate<Integer, Integer> test = (var x, final var y) -> (x.equals(y)); BiPredicate<Integer, Integer> test2 = (Integer x, final Integer y) -> (x.equals(y));

Abu_MuhammadOptions: BE
Jun 15, 2023

B and E, as var parameters cannot be mixed with other (typed) parameters

OmnisumemOptions: BE
Sep 13, 2023

Tested: B and E.

d7bb0b2Options: BE
Jan 6, 2024

B AND E: BiPredicate<Integer, Integer> test = (final Integer x, var y) -> (x.equals(y)); => BAD MIX TYPES BiPredicate<Integer, Integer> test2 = (var x, final var y) -> (x.equals(y)); => OK BiPredicate<Integer, Integer> test3 = (Integer x, final var y) -> (x.equals(y)); => MIX BiPredicate<Integer, Integer> test4 = (final var x, y) -> (x.equals(y)); => Y NOT TYPE BiPredicate<Integer, Integer> test5 = (Integer x, final Integer y) -> (x.equals(y)); => OK

StavokOptions: BE
Jun 3, 2023

B&E are correct

[Removed]Options: BE
Aug 29, 2023

BE are correct

gnilapon.ebenezaireOptions: BE
Jul 17, 2024

Good definitions