MCPcopy Index your code
hub / github.com/BruceEckel/OnJava8-Examples / main

Method main

collectiontopics/FillingLists.java:17–25  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

15
16public class FillingLists {
17 public static void main(String[] args) {
18 List<StringAddress> list = new ArrayList<>(
19 Collections.nCopies(4,
20 new StringAddress("Hello")));
21 System.out.println(list);
22 Collections.fill(list,
23 new StringAddress("World!"));
24 System.out.println(list);
25 }
26}
27/* Output:
28[StringAddress@19e0bfd Hello, StringAddress@19e0bfd

Callers

nothing calls this directly

Calls 1

fillMethod · 0.65

Tested by

no test coverage detected