LogiQuest
Back to Flow Control
3

What is the output of the following program?

public class Main {
    public static void main(String[] args) {
        int day = 3;
        switch (day) {
            case 1: System.out.print("A");
            case 3: System.out.print("B");
            case 4: System.out.print("C");
                break;
            default: System.out.print("D");
        }
    }
}
Medium

Discussion (0)

  • No discussion yet. Ask a doubt or share a shortcut.

Log in to join the discussion.