LogiQuest
Back to Flow Control
12

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.println("Mon");
            case 3 -> System.out.println("Wed");
            default -> System.out.println("Other");
        }
    }
}
Easy

Discussion (0)

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

Log in to join the discussion.