Examveda
Examveda

What is the output of the following code snippet?

int p = 3;
switch (p) {
case 1: System.out.print("One");
case 2: System.out.print("Two");
default: System.out.print("Default");
}

A. Default

B. OneTwoDefault

C. One

D. Default

Answer: Option B


This Question Belongs to Java Program >> Flow Control

Join The Discussion

Related Questions on Flow Control