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 8 Question 87 Discussion
Oracle Exam 1Z0-819 Topic 8 Question 87 Discussion
Actual exam question for Oracle's 1Z0-819 exam
Question #: 87
Topic #: 8
[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
Kristine
at
Aug 07, 2024, 09:10 PM
Limited Time Offer
25%
Off
Get Premium 1Z0-819 Questions as Interactive Web-Based Practice Test or PDF
Contribute your Thoughts:
Submit
Cancel
Ahmed
3 months ago
Hmm, that makes sense. But I still think option A is more concise and clear.
upvoted
0
times
...
Jade
3 months ago
I disagree, I believe option C is the right choice as it includes the return statement within curly braces.
upvoted
0
times
...
Ahmed
3 months ago
I think option A is correct because it directly returns the result of i * 2.
upvoted
0
times
...
Lenna
3 months ago
I think option D is definitely incorrect because it has a syntax error with the closing parenthesis.
upvoted
0
times
...
Mila
4 months ago
I agree with Willard. Option B is the way to do it. Nice and concise.
upvoted
0
times
...
Willard
4 months ago
Option B is the correct answer. Using 'var' for the parameter type is the way to go in this case.
upvoted
0
times
Jeannine
2 months ago
Option D has a syntax error, the closing curly brace should be before the parenthesis.
upvoted
0
times
...
Stevie
2 months ago
I prefer option C, using curly braces for the return statement is more readable.
upvoted
0
times
...
Georgeanna
2 months ago
I disagree, option B is more concise and modern with 'var'.
upvoted
0
times
...
Jolene
3 months ago
I think option A is better, using 'int' explicitly makes it clearer.
upvoted
0
times
...
Raina
3 months ago
Yes, using 'var' for the parameter type is the way to go in this case.
upvoted
0
times
...
Raina
4 months ago
I think option B is the correct answer.
upvoted
0
times
...
...
Arlette
4 months ago
But option C also seems valid as it includes a return statement within curly braces.
upvoted
0
times
...
Barrie
4 months ago
I disagree, I believe option B is the correct answer as it uses the 'var' keyword for type inference.
upvoted
0
times
...
Arlette
4 months ago
I think option A is correct because it specifies the data type for the parameter.
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
Ahmed
3 months agoJade
3 months agoAhmed
3 months agoLenna
3 months agoMila
4 months agoWillard
4 months agoJeannine
2 months agoStevie
2 months agoGeorgeanna
2 months agoJolene
3 months agoRaina
3 months agoRaina
4 months agoArlette
4 months agoBarrie
4 months agoArlette
4 months ago