Menu
Question Index
...

What will be the output of the following program?

public class DemoOnSwitch
{
    public static void main(String[] args)
    {
        int var = 12;
        switch (var)
        {
            case 014 :
                System.out.print("Hello");
                break;
            case 12 :
                System.out.print("Hi");
            default :
                System.out.print("How r u?");
        }
    }
}


Hello
Hi
How r u?
HelloHow r u
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