exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 99 discussion

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

Given the code fragment:

What is the result?
A.

B.

C.

D.

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
iSnover
Highly Voted 9 months, 4 weeks ago
Correct is D. To be 3, in secound line needs (1 + 2) and not "(1) + (2)" or "1 + 2". When have String + in "Println", the numbers need to sum be in an expression without non-primitive types or be enclosed in parentheses also without non-primitive types. When you have a non-primitive type together with a primitive in println, concatenation is done. Here's the logic of the expression: Result + (1) + (2) Result + 1 + 2 ---------------------------- Result 12
upvoted 6 times
...
spongecodes
Most Recent 4 months ago
Java expressions are left associative so entire expression is evaluated as String so D
upvoted 2 times
...
kkaayyyy
9 months, 1 week ago
It's D. Result A is 01 Result B is 12
upvoted 3 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