BruceEckel/OnJava8-Examples

About enums in switch Statements

antaow opened this issue · 0 comments

Bruce,

When I read your chapter on Enumerations, In the section of enums in switch Statements, original text:the compiler will complain if you don’t have a default—even if you’ve covered all the possible values of the enum.

The question is as follows:

when I don't use a default,my compiler doesn't give any error .

CleanShot 2022-06-28 at 21 37 42@2x

My java version is "17.0.1" 2021-10-19 LTS