Snailclimb / Snailclimb/JavaGuide

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

Open
#2,649 2 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
159k
Forks
46.1k
Avg merge
14h 36m
Merged PRs (30d)
6

Description

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

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the section describing the six ways to convert an array to a collection and review the explanation of Java 9's List.of(). Confirm how its mutability is described, then update the documentation so the method is explicitly identified as returning an immutable collection and the distinction from Arrays.asList is clear.

Written by the indexing model from the issue text.

Assessment

Tech stack
java
Domain
documentation
Issue type
Documentation
Difficulty
1/5
Estimated time
Under an hour
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.