Question
What will be the value of y after execution of switch statement?
public class Test{
public static void main(String[] args){
int x = 3, y = 4;
switch(x + 3){
case 6: y = 0;
case 7: y = 1;
default: y += 1;
}
}
}
public class Test{
public static void main(String[] args){
int x = 3, y = 4;
switch(x + 3){
case 6: y = 0;
case 7: y = 1;
default: y += 1;
}
}
}
Answer: Option B
Submit Your Solution Below and Earn Points !
Submit Your Solution Below and Earn Points !
Submit Solution