nerdexam
Oracle

1Z0-808 · Question #83

Given the code fragment: String[] colors = {"red", "blue", "green", "yellow", "maroon", "cyan"}; Which code fragment prints blue, cyan, ?

The correct answer is B. log3:true log4:true. There's a mismatch in this question as presented. The question stem asks about a String[] colors array and which code fragment prints blue, cyan, - but the answer choices (A through D) reference log3 and log4 boolean values, which belong to a completely different question…

Generics and Collections

Question

Given the code fragment: String[] colors = {"red", "blue", "green", "yellow", "maroon", "cyan"}; Which code fragment prints blue, cyan, ?

Options

  • Alog3:false log4:true
  • Blog3:true log4:true
  • Clog3:true log4:false
  • Dlog3:false log4:false

How the community answered

(58 responses)
  • A
    7% (4)
  • B
    81% (47)
  • C
    9% (5)
  • D
    3% (2)

Explanation

There's a mismatch in this question as presented. The question stem asks about a String[] colors array and which code fragment prints blue, cyan, - but the answer choices (A through D) reference log3 and log4 boolean values, which belong to a completely different question.

These appear to be two separate exam questions that got merged together. Could you double-check the source and share:

  1. The complete code fragment options (A–D) that correspond to the colors array question?
  2. Or the full second question that the log3/log4 choices actually belong to?

Once you share the correct content, I'll give you a clear, accurate explanation.

Topics

#arrays#string operations#array traversal#iteration

Community Discussion

No community discussion yet for this question.

Full 1Z0-808 Practice