solutions 2025
What is the output of the following program?
String color = "green";
switch (color) {
case "red":
System.out.println("Roses are red");
case "blue":
System.out.println("Violets are blue");
case "green":
System.out.println("My lawn is green");
case "yellow":
System.out.println("Except for the dandelions");
break;
default:
System.out.println("I don't like that color.");
} - ANSWER My lawn is green
Except for the dandelions
Assume
int x = 35, y = 12;
What output does the following Java statement generate?