Returns an immutable list consisting of n
copies of the
specified object. The newly allocated data object is tiny (it contains
a single reference to the data object). This method is useful in
combination with the List.addAll
method to grow lists.
The returned list is serializable.
<T> | the class of the object to copy and of the objects in the returned list. | |
n | the number of elements in the returned list. | |
o | the element to appear repeatedly in the returned list. |
n
copies of the
specified object.
IllegalArgumentException | if n < 0 |
List.addAll(Collection), List.addAll(int, Collection)
Diagram: Collections