Menu
Question Index
...

What will be the output of the following program.

class WeekDays
{
    public static void main(String s[])
    {
        int day = 7;

        switch(day)
        {
            case 1:
                System.out.println("Monday");
            case 2:
                System.out.println("Tuesday");
            case 3:
                System.out.println("Wednesday");
            case 4:
                System.out.println("Thursday");
            case 5:
                System.out.println("Friday");
        }
    }
}


No Output
Compilation Error
Sunday
Runtime error

Doubts

Problems

Topic: switch Statement In Java

Read this topic
Take test on this topic

0
Wrong
Score more than 2 points

© meritcampus 2019

All Rights Reserved.

Open In App