Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

class definitions could start with keyword enum #2643

Merged
merged 2 commits into from
Aug 3, 2020
Merged

class definitions could start with keyword enum #2643

merged 2 commits into from
Aug 3, 2020

Conversation

ezksd
Copy link
Contributor

@ezksd ezksd commented Aug 2, 2020

Enum is a special type in java, which doesn't like enum in other programming languages. It's not a primitive type, enum has the same construct of class. We also consider it a syntax sugar to define a special class. And enum definition located at subchapter of classes in java language specification too.

enum Coin {
    PENNY(1), NICKEL(5), DIME(10), QUARTER(25);
    Coin(int value) { this.value = value; }

    private final int value;
    public int value() { return value; }
}

@joshgoebel
Copy link
Member

Looks good. Please also update CHANGES.md

@joshgoebel joshgoebel merged commit a2a7db5 into highlightjs:master Aug 3, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants