Question: If a has the value 3 , what is the result of running the following code? switch ( a ) { case 1 : System.out.print

If a has the value 3, what is the result of running the following code?
switch(a){
case 1: System.out.print(1);
case 2:
case 3: System.out.print(3);
case 4:
case 5: System.out.print(5);
default: System.out.print(0);}
A) The value 3 is printed.
B) The values 3 and 0 are printed.
C) The values 3 and 5 are printed.
D) The values 1,3, and 5 are printed.
E) The values 3,5, and 0 are printed.

Step by Step Solution

There are 3 Steps involved in it

1 Expert Approved Answer
Step: 1 Unlock blur-text-image
Question Has Been Solved by an Expert!

Get step-by-step solutions from verified subject matter experts

Step: 2 Unlock
Step: 3 Unlock

Students Have Also Explored These Related Databases Questions!