giovedì 28 marzo 2013

Q32

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
B.
Found Red
Found Blue
C.
Found Red
Found Blue
Found White
D.
Found Red
Found Blue
Found White
Found Default
Risposta B:

Found Red
Found Blue


riferimenti : case

 

Nessun commento:

Posta un commento