1Z0-811 Java Basics and Syntax Practice Question
Given: int day = 3; switch(day) { case 1: System.out.print("A"); case 2: System.out.print("B"); case 3: System.out.print("C"); case 4: System.out.print("D"); } What prints?
⚠ Common exam trap
The 1Z0-811 exam often tests fall-through behavior by omitting break statements, trapping candidates who assume only the matched case executes.
Answer choices
Why each option matters
Answer the question above first, then reveal the full breakdown to understand why each option is right or wrong.
Correct answer & explanation
✓
"CD"
The switch statement does not have break statements, so after matching case 3, execution falls through to case 4, printing 'C' then 'D'. The output is 'CD'.
Answer analysis
Option-by-option breakdown
For each option: why learners choose it and why it is or isn't the right answer here.
- ✗
"BCD"
Why it's wrong here
Incorrect. No fall-through from case 2.
- ✓
"CD"
Why this is correct
Correct. Falls through from case 3 to case 4.
- ✗
"C"
Why it's wrong here
Incorrect. Fall-through causes case 4 to execute.
- ✗
"ABCD"
Why it's wrong here
Incorrect. Only cases 3 and 4 are entered.
Go deeper
Related to this question
About these practice questions
One of 481 original 1Z0-811 practice questions on Courseiva, each with a full explanation and wrong-answer analysis — not exam dumps or protected exam content. Learn why practice questions differ from exam dumps →
JA
Written by Johnson Ajibi, MSc IT Security
Senior Network & Security Engineer · founder of Courseiva
This 1Z0-811 practice question is part of Courseiva's free Oracle certification practice question bank. Courseiva provides original exam-style practice questions with explanations, topic-based practice, mock exams, readiness tracking, and study analytics to help learners prepare for the 1Z0-811 exam.