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

关于数组转集合方法的第六种:使用Java9的List.of() #2649

Open
common5 opened this issue Mar 19, 2025 · 1 comment
Open

关于数组转集合方法的第六种:使用Java9的List.of() #2649

common5 opened this issue Mar 19, 2025 · 1 comment

Comments

@common5
Copy link

common5 commented Mar 19, 2025

在前面举例说使用Arrays.asList得到的集合不支持增删方法的语境下,我认为下面所提供的数组转集合六种方法应该得到的是可变的集合。
但List.of()返回的是一个不可变的集合,这个方法是不是应该标注一下,它返回的是不可变集合(java.util.ImmutableCollections),避免混淆

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

No branches or pull requests

2 participants
@common5 and others