exam questions

Exam 1z0-819 All Questions

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

Exam 1z0-819 topic 1 question 206 discussion

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

Given:



What is the result?

  • A. Oracle
  • B. An exception is thrown at run time.
  • C. Java
  • D. Compilation error
Show Suggested Answer Hide Answer
Suggested Answer: D 🗳️

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
Omnisumem
3 months ago
Selected Answer: D
tested
upvoted 2 times
...
d7bb0b2
6 months, 1 week ago
Selected Answer: D
variables in lambdas must be a final or effectively final. If s is modified then code not compile
upvoted 1 times
...
ASPushkin
6 months, 2 weeks ago
right answer is D Local variables decalred in the enclosing method, including its formal parameters, can be accessed in a lambda expression provided and they are effectively final This one : String s = "Oracle"; Runnable r = () -> { System.out.println(s); }; //s = "Java"; Thread t = new Thread(r); t.start() will be ok
upvoted 2 times
d7bb0b2
6 months, 1 week ago
that is ok, variables in lambdas must be a final or effectively final. If s is modified then code not compile
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