nerdexam
Oracle

1Z0-829 · Question #16

1Z0-829 Question #16: Real Exam Question with Answer & Explanation

Sign in or unlock 1Z0-829 to reveal the answer and full explanation for question #16. The question stem and answer options stay visible for context.

Working with Streams and Lambda expressions

Question

public enum Desig { CEO('A'), CMO('B'), CTO('C'), CFO('D'); char c; private Desig(char c) { this.c = c; } } and the code fragment: Arrays.stream(Desig.values()).dropWhile(s -> s.equals(Desig.CMO)); switch (Desig.valueOf("CMO")) { case CEO -> System.out.println("Executive"); case CMO -> System.out.println("Marketing"); case CFO -> System.out.println("Finance"); case CTO -> System.out.println("Technical"); default -> System.out.println("Undefined"); } What is the result?

Options

  • AMarketing
  • BFinance
  • CTechnical
  • DUndefined
  • EMarketing

Unlock 1Z0-829 to see the answer

You've previewed enough free 1Z0-829 questions. Unlock 1Z0-829 for full answers, explanations, the timed quiz mode, progress tracking, and the master PDF. Question stem and options stay visible so you can still see what's on the exam.

Topics

#enums#pattern matching#streams#switch expressions
Full 1Z0-829 Practice