Oracle
1Z0-819 · Question #177
1Z0-819 Question #177: Real Exam Question with Answer & Explanation
Sign in or unlock 1Z0-819 to reveal the answer and full explanation for question #177. The question stem and answer options stay visible for context.
Question
Given:
public class Main {
public static void main(String[] args) {
import java.time.LocalDate;
import static java.time.DayOfWeek.*;
var today = LocalDate.now().with(TUESDAY).getDayOfWeek();
switch (today) {
case SATURDAY:
System.out.println("Weekend");
break;
case MONDAY:
case FRIDAY:
System.out.println("Working");
break;
default:
System.out.println("Unknown");
}
}
}
What is the result?
Options
- AWorkingUnknown
- BUnknown
- CTuesdayUnknown
- DThe compilation fails.
- ETuesday
- FWorking
Unlock 1Z0-819 to see the answer
You've previewed enough free 1Z0-819 questions. Unlock 1Z0-819 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.