X Tutup
The Wayback Machine - https://web.archive.org/web/20210207150829/https://github.com/Snailclimb/JavaGuide/issues/922
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

"使用 == 比较枚举类型"一节中一处不理解的描述 #922

Closed
wenpeng opened this issue Sep 7, 2020 · 1 comment
Closed

"使用 == 比较枚举类型"一节中一处不理解的描述 #922

wenpeng opened this issue Sep 7, 2020 · 1 comment

Comments

@wenpeng
Copy link
Contributor

@wenpeng wenpeng commented Sep 7, 2020

我们看另一个示例,两个不同枚举类型进行比较,使用equal方法比较结果确定为true,因为getStatus方法的枚举值与另一个类型枚举值一致...

"两个不同枚举类型进行比较,使用equal方法比较结果确定为true" 这个结论是如何得来?怎么理解呢?

Repository owner deleted a comment from guorong2705 Oct 7, 2020
@Snailclimb
Copy link
Owner

@Snailclimb Snailclimb commented Oct 7, 2020

参见:https://stackoverflow.com/questions/1750435/comparing-java-enum-members-or-equals
另外:
刚有个人才评论这段话是我直接复制粘贴的,就是这位 @guorong2706 ,因为评论过于脑残我就给删除了。
请仔细看文章。
image

@Snailclimb Snailclimb closed this Oct 7, 2020
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
2 participants
X Tutup