Single Choice Not Set

QWhat 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;
                }
        }
}

ID: #2142 Java Control Flow 833 views
Question Info
#2142Q ID
Not SetDifficulty
Java Control FlowTopic

Choose the Best Option

Click any option to instantly check if you're correct.

  • A 1
  • B 2
  • C 3
  • D 4
Correct Answer

Explanation

2

Share This Question

Challenge a friend or share with your study group.