A switch statement without break
QuizEasy-MediumJava only
What does this print?
int day = 2;
switch (day) {
case 1: System.out.print("Mon ");
case 2: System.out.print("Tue ");
case 3: System.out.print("Wed "); break;
case 4: System.out.print("Thu ");
default: System.out.print("Other ");
}Tue WedTueTue Wed Thu OtherMon Tue Wed
This question is part of Pro+
Pro+ opens every question in Interview Prep and the mock interview. Every article and the first 2 questions of each topic stay free. Hands-on Selenium and API tasks follow their course lesson's own lock.