Cyber Monday 2024! Hurry Up, Grab the Special Discount - Save 25%
- Ends In
00:00:00
Coupon code:
SAVE25
X
Welcome to Pass4Success
Login
|
Sign up
-
Free
Preparation Discussions
Mail Us
support@pass4success.com
Location
PL
MENU
Home
Popular vendors
Salesforce
Microsoft
Nutanix
Cisco
Amazon
Google
CompTIA
SAP
VMware
Oracle
Fortinet
PeopleCert
Eccouncil
HP
Palo Alto Networks
Adobe
ISC2
ServiceNow
Dell EMC
CheckPoint
Discount Deals
New
About
Contact
Login
Sign up
Home
Discussions
Oracle Discussions
Exam 1Z0-819 Topic 10 Question 75 Discussion
Oracle Exam 1Z0-819 Topic 10 Question 75 Discussion
Actual exam question for Oracle's 1Z0-819 exam
Question #: 75
Topic #: 10
[All 1Z0-819 Questions]
Given the code fragment:
Which can replace line 2?
A
UnaryOperator u = (int i) -> i * 2;
B
UnaryOperator u = (var i) -> (i * 2);
C
UnaryOperator u = var i -> { return i * 2; };
D
UnaryOperator u = i -> { return i * 2);
Show Suggested Answer
Hide Answer
Suggested Answer:
B
by
Fernanda
at
Mar 10, 2024, 07:35 AM
Limited Time Offer
25%
Off
Get Premium 1Z0-819 Questions as Interactive Web-Based Practice Test or PDF
Contribute your Thoughts:
Submit
Cancel
Brett
6 months ago
I would choose option B because it uses the 'var' keyword for type inference which is more modern.
upvoted
0
times
...
Tammi
7 months ago
I think Vanda is right, option C is more readable and explicit in its return statement.
upvoted
0
times
...
Iraida
7 months ago
But doesn't option C have unnecessary curly braces around the lambda body?
upvoted
0
times
...
Vanda
7 months ago
I disagree, I believe option C is the correct one as it includes the return statement.
upvoted
0
times
...
Iraida
7 months ago
I think option A is correct because it uses the lambda expression correctly.
upvoted
0
times
...
Log in to Pass4Success
×
Sign in:
Forgot my password
Log in
Report Comment
×
Is the comment made by
USERNAME
spam or abusive?
Commenting
×
In order to participate in the comments you need to be logged-in.
You can
sign-up
or
login
Save
Cancel
az-700
pass4success
az-104
200-301
200-201
cissp
350-401
350-201
350-501
350-601
350-801
350-901
az-720
az-305
pl-300
Brett
6 months agoTammi
7 months agoIraida
7 months agoVanda
7 months agoIraida
7 months ago