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

Method main

collections/SetOfString.java:8–21  ·  view source on GitHub ↗
(String[] args)

Source from the content-addressed store, hash-verified

6
7public class SetOfString {
8 public static void main(String[] args) {
9 Set<String> colors = new HashSet<>();
10 for(int i = 0; i < 100; i++) {
11 colors.add("Yellow");
12 colors.add("Blue");
13 colors.add("Red");
14 colors.add("Red");
15 colors.add("Orange");
16 colors.add("Yellow");
17 colors.add("Blue");
18 colors.add("Purple");
19 }
20 System.out.println(colors);
21 }
22}
23/* Output:
24[Red, Yellow, Blue, Purple, Orange]

Callers

nothing calls this directly

Calls 1

addMethod · 0.45

Tested by

no test coverage detected