Menu
Question Index
...

What will be the output of the following program?

public class KIs {
    public static void main(String args[]) {
        int k = 65;
        switch (k) {
            default :
                System.out.print("Website");
            case 65 :
                System.out.print("Merit");
            case 'k' :
                System.out.print("Campus");
            case 'j' :
                System.out.print("Java");
                break;
        }
    }
}


WebsiteMeritCampusJava
MeritCampusJavaWebsite
Merit
MeritWebsite
Some other output
Compilation Error or 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