Q32
Given the code fragment:
String color = "Red";
switch (color) {
case "Red":
System.out.println("Found Red");
case "Blue":
System.out.println("Found Blue");
break;
case "White":
System.out.println("Found White");
break;
default:
System.out.println("Found Default");
}
What is the
result?
A.
Found Red
Found Red
B.
Found Red
Found Blue
Found Red
Found Blue
C.
Found Red
Found Blue
Found White
Found Red
Found Blue
Found White
D.
Found Red
Found Blue
Found White
Found Default
Found Red
Found Blue
Found White
Found Default
Risposta B:
Found Red
Found Blueriferimenti : case
Nessun commento:
Posta un commento