Oracle
1Z0-850 · Question #47
1Z0-850 Question #47: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-850 to reveal the answer and full explanation for question #47. The question stem and answer options stay visible for context.
Question
Given:
- public enum Color { RED, YELLOW, GREEN }
- enum Fruit {
- Banana(Color.RED),
- Apple(Color.YELLOW),
- Kiwi(Color.GREEN);
- private Color color;
- Fruit(Color color) {
- this.color = color;
- }
- }
- class Test {
- public void method() {
- // insert code here
- }
- } Which two, inserted independently at line 13, allow the code to compile? (Choose two.)
Options
- AColor red = Color.values()[0];
- BFruit f = Banana;
- CFruit[] fruits = Fruit.values();
- DFruit f = new Fruit(Color.RED);
- EFruit f = Fruit.Banana; switch (f) {}
Unlock 1Z0-850 to see the answer
You've previewed enough free 1Z0-850 questions. Unlock 1Z0-850 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.