exam questions

Exam 1z0-808 All Questions

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

Exam 1z0-808 topic 1 question 186 discussion

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

Given the code fragment:

What is the result?

  • A. 2 : 7 : 3
  • B. 7 : 7 : 9
  • C. 2 : 7 : 0
  • D. 7 : 2 : 3
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
carloswork
8 months ago
Selected Answer: D
Answer is D. To test: public static void main(String[] args) { int a = 3; int b = 2; int c = 1; int r1 = a * b / c + 1; int r2 = a / b * c + 1; int r3 = a * (b / (c + 1)); System.out.println(r1 + " : " + r2 + " : " + r3); }
upvoted 1 times
...
iSnover
8 months, 3 weeks ago
Selected Answer: D
The correct answer is the letter D, remembering that we can divide "int" types even if there is leftover, dividing 3 by 2 would give "1.5" but as the whole number it cuts the decimal places getting "1" and making the code compile normally. Just doing the result of "r1" and "r2" you can already have the result without having to calculate "r3", the OCA test asks questions like this for you to waste time with distractors and time in a test that requires attention in every question is gold.
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 ...