Oracle
1Z0-809 · Question #179
1Z0-809 Question #179: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-809 to reveal the answer and full explanation for question #179. The question stem and answer options stay visible for context.
Question
Given the code fragment:
int wd = 0;
string days[] = {"sun", "mon", "wed", "sat"};
switch (days[wd]) {
case "sun":
wd = 1;
break;
case "mon":
wd = 2;
break;
case "wed":
wd = 2;
break;
case "sat":
wd = 3;
}
System.out.println(wd);
What is the result?
Options
- A-1
- B4
- CCompilation fails.
- D3
Unlock 1Z0-809 to see the answer
You've previewed enough free 1Z0-809 questions. Unlock 1Z0-809 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.