exam questions

Exam 1z0-819 All Questions

View all questions & answers for the 1z0-819 exam

Exam 1z0-819 topic 1 question 22 discussion

Actual exam question from Oracle's 1z0-819
Question #: 22
Topic #: 1
[All 1z0-819 Questions]

Which two are valid statements? (Choose two.)

  • A. BiPredicate<Integer, Integer> test = (final Integer x, var y) -> (x.equals(y));
  • B. BiPredicate<Integer, Integer> test = (var x, final var y) -> (x.equals(y));
  • C. BiPredicate<Integer, Integer> test = (Integer x, final var y) -> (x.equals(y));
  • D. BiPredicate<Integer, Integer> test = (final var x, y) -> (x.equals(y));
  • E. BiPredicate<Integer, Integer> test = (Integer x, final Integer y) -> (x.equals(y));
Show Suggested Answer Hide Answer
Suggested Answer: BE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
ASPushkin
4 months, 3 weeks ago
Selected Answer: BE
- var i1 = 1, i2 = 2; - ERROR - var isn't allowed in a compound declaration - can not mix var with explicit types (var s1, String s2) - local variables declared with var are non-final by default. However, the final modifier can be added to var declarations:
upvoted 1 times
...
gnilapon.ebenezaire
6 months, 2 weeks ago
Selected Answer: BE
Good definitions
upvoted 1 times
...
d7bb0b2
1 year ago
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
upvoted 2 times
...
Omnisumem
1 year, 4 months ago
Selected Answer: BE
Tested: B and E.
upvoted 2 times
...
[Removed]
1 year, 5 months ago
Selected Answer: BE
BE are correct
upvoted 1 times
...
AbuMuhammad
1 year, 7 months ago
B and E, as var parameters cannot be mixed with other (typed) parameters
upvoted 2 times
...
Stavok
1 year, 8 months ago
Selected Answer: BE
B&E are correct
upvoted 1 times
...
JGR_77
1 year, 10 months ago
Selected Answer: BE
BiPredicate<Integer, Integer> test = (var x, final var y) -> (x.equals(y)); BiPredicate<Integer, Integer> test2 = (Integer x, final Integer y) -> (x.equals(y));
upvoted 2 times
...
RP384
2 years ago
Selected Answer: BE
B and E are correct
upvoted 3 times
...
Leksh_geeth
2 years, 2 months ago
Correct answer is BE
upvoted 3 times
...
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.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago