nerdexam
Oracle

1Z0-803 · Question #182

Given: What is the result?

The correct answer is B. 10 : 22 : 22. The code manipulates several variables, resulting in the final printed values 10, 22, and 22, indicating specific assignments and transformations.

Working with Java Data Types

Question

Given:

What is the result?

Exhibit

1Z0-803 question #182 exhibit

Options

  • A10 : 22 : 20
  • B10 : 22 : 22
  • C10 : 22 : 6
  • D10 : 30 : 6

How the community answered

(70 responses)
  • A
    19% (13)
  • B
    71% (50)
  • C
    3% (2)
  • D
    7% (5)

Why each option

The code manipulates several variables, resulting in the final printed values 10, 22, and 22, indicating specific assignments and transformations.

A10 : 22 : 20

The operations do not result in the third value being 20, as it is updated to 22.

B10 : 22 : 22Correct

The sequence of operations on the variables leads to the first variable holding the value 10, the second variable holding 22, and the third variable also holding 22. This often happens if the third variable is assigned the value of the second variable at some point.

C10 : 22 : 6

The operations do not result in the third value being 6, as it is updated to 22.

D10 : 30 : 6

The operations do not result in the second value being 30, nor the third value being 6.

Concept tested: Variable assignment and state change

Topics

#variable scope#output prediction#operators#data types

Community Discussion

No community discussion yet for this question.

Full 1Z0-803 Practice