Java SE 8 Programmer I — Question 58

Which statement is true about the switch statement?

Answer options

Correct answer: D

Explanation

The correct answer is D because the switch statement's expression must yield a single value for it to function correctly. Option A is incorrect since a default section is not mandatory, B is wrong as the break statement is not always required, and C is false because case label literals cannot be modified during runtime.