CJCoding With Joseph
15free / daySign inCreate account
Back to Multiple Choice Quiz

Select topics to narrow your question pool, then enable Random to jump to a random question matching your filters.

Topics

Switch to If Else

Java quiz · Question 8
mediumConditionals

Which if-else statement is equivalent to the given switch statement?

Code

1switch (grade) {
2 case 'A':
3 System.out.println("Excellent");
4 break;
5 case 'B':
6 System.out.println("Good");
7 break;
8 default:
9 System.out.println("Average");
10}