nerdexam
Oracle

1Z0-809 · Question #271

Given the code fragment: List<String> codes = Arrays.asList ("B", "C", "A", "D"); codes.parallelStream().forEach (s -> System.out.print (s)); System.out.println ("")…

The correct answer is C. ABCD // in random order BCAD. You've hit your session limit · resets 5:20pm (America/New_York)

Question

Given the code fragment: List<String> codes = Arrays.asList ("B", "C", "A", "D"); codes.parallelStream().forEach (s -> System.out.print (s)); System.out.println (""); codes.parallelStream().forEachOrdered(s1 -> System.out.print (s1)); What is the result?

Options

  • AACBD // in random order ABCD
  • BABCD // in random order ABCD
  • CABCD // in random order BCAD
  • DA compile time error occurs.

How the community answered

(39 responses)
  • A
    8% (3)
  • B
    18% (7)
  • C
    72% (28)
  • D
    3% (1)

Explanation

You've hit your session limit · resets 5:20pm (America/New_York)

Community Discussion

No community discussion yet for this question.

Full 1Z0-809 Practice