Skip to content

About enums in switch Statements #58

@antaow

Description

@antaow

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions