5.6 switch Multiple-Selection Statement

Chapter 4 discussed the if single-selection statement and the if...else double-selection statement. The switch multiple-selection statement performs different actions based on the possible values of a constant integral expression of type byte, short, int or char. As of Java SE 7, the expression may also be a String, which we discuss in Section 5.7.

Get Java™ How To Program (Early Objects), Tenth Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.