MCPcopy Create free account
hub / github.com/ShivaBhattacharjee/KeyZen / CollectionsDemo

Class CollectionsDemo

data/java/03_collections.java:6–23  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4import java.util.Map;
5
6class CollectionsDemo {
7 public static void main(String[] args) {
8 List<String> words = new ArrayList<>();
9 words.add("focus");
10 words.add("rhythm");
11 words.add("precision");
12
13 Map<String, Integer> scores = new HashMap<>();
14 scores.put("Ava", 82);
15 scores.put("Leo", 77);
16
17 for (String word : words) {
18 System.out.println(word.toUpperCase());
19 }
20
21 scores.forEach((name, wpm) -> System.out.println(name + ": " + wpm));
22 }
23}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected