Skip to main content
Journey Uncommon Logo
JourneyUncommon
mediumJavaCollectors toMap groupingBySingle-choice MCQ

What does the value type of the resulting map look like?

import java.util.*; import java.util.stream.*; public class Main { public static void main(String[] args) { var byLen = Stream.of("ant", "bee", "cat", "dog", "elk") .collect(Collectors.groupingBy( String::length, Collectors.counting())); System.out.println(byLen); } }