logo

Crowdly

Browser

Add to Chrome

Mida kuvatakse konsooli? Map<String, List<Integer>> data = new HashMap<>(); d...

✅ The verified answer to this question is available below. Our community-reviewed solutions help you understand the material better.

Mida kuvatakse konsooli?

Map<String, List<Integer>> data = new HashMap<>();

data.put("A", new ArrayList<>(List.of(1, 2, 3)));

data.put("B", new ArrayList<>(List.of(4, 5)));

data.put("C", new ArrayList<>(List.of(6)));

int total = 0;

for (Map.Entry<String, List<Integer>> entry : data.entrySet()) {

if (entry.getValue().size() > 1) {

for (Integer num : entry.getValue()) {

total += num;

}

}

}

System.out.println(total);

0%
0%
0%
More questions like this

Want instant access to all verified answers on moodle.taltech.ee?

Get Unlimited Answers To Exam Questions - Install Crowdly Extension Now!

Browser

Add to Chrome