Topic: 1z0-819 topic 1 question 206
Given:
What is the result?
A.
Oracle
B.
An exception is thrown at run time.
C.
Java
D.
Compilation error
IT Certification exam information exchange, brain dumps discussions sharing.
You are not logged in. Please login or register.
Share Test → Oracle Certifications → 1z0-819 topic 1 question 206
Given:
What is the result?
A.
Oracle
B.
An exception is thrown at run time.
C.
Java
D.
Compilation error
tested
variables in lambdas must be a final or effectively final. If s is modified then code not compile
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
that is ok, variables in lambdas must be a final or effectively final. If s is modified then code not compile
Share Test → Oracle Certifications → 1z0-819 topic 1 question 206
Note: This forum is a platform for users to share insights and discuss exam-related topics. We do not provide authentic exam questions or answers. The content here is contributed by community members and is meant for collaborative learning and discussion purposes only. Users are encouraged to refer to official sources for accurate exam materials.