Warning. The old-style switch statement

[comp1110-2L]

Older versions of Java used a different syntax for switch statements:

switch (m) { case JANUARY: IO.println("Jan"); break; case FEBRUARY: IO.println("Feb"); break; ... }

This version uses case labels and colons, and each branch usually ends with break. If break is omitted, execution falls through into the next case, which often causes mistakes. Therefore, in this course we will use the arrow form and not the older colon style.

bars magnifying-glass caret-down plus minus arrow-right xmark