The Wayback Machine - https://web.archive.org/web/20210102170913/https://github.com/AobingJava/JavaFamily/issues/55
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

枚举文章内容不完善 #55

Open
citrucn opened this issue Nov 29, 2020 · 0 comments
Open

枚举文章内容不完善 #55

citrucn opened this issue Nov 29, 2020 · 0 comments

Comments

@citrucn
Copy link

@citrucn citrucn commented Nov 29, 2020

枚举类编译之后是final类型的,文章中说的abstract类型是因为类中定义了抽象方法。
关于内部类:
这种形式编译之后不会生成内部类

enum Season{
    Spring;
}

这种形式编译之后会生成内部类

enum Season{
    Spring(){
    };
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
1 participant
You can’t perform that action at this time.