exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 159 discussion

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

Given:



Which is true?

  • A. The code prints 25.
  • B. The code does not compile.
  • C. The code throws an exception at runtime.
  • D. The code compiles but does not print any result.
Show Suggested Answer Hide Answer
Suggested Answer: B 🗳️

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
d7bb0b2
6 months, 4 weeks ago
Selected Answer: B
variables in lamba must be effectively final or final, whhen i is modified i++, compilation error is show.
upvoted 1 times
...
Omnisumem
9 months, 4 weeks ago
Selected Answer: B
error: local variables referenced from a lambda expression must be final or effectively final
upvoted 1 times
...
Stavok
1 year ago
Selected Answer: B
B is correct
upvoted 1 times
...
KiraguJohn
1 year ago
Answer is B. lambda expressions work with final variables, as well as effectively final variables. The moment you do something like i++ the variable i will be no longer treated as final
upvoted 1 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