// Maven <dependency> <groupId>commons-collections</groupId> <artifactId>commons-collections</artifactId> <version>3.2.2</version> </dependency> // Gradle compile group: 'commons-collections', name: 'commons-collections', version: '3.2.2' import org.apache.commons.collections4.*; import org.apache.commons.collections4.multimap.*; public class MultimapExample { public static void main(String[] args) { Multimap<String, String> multimap = Multimaps.newListMultimap(new HashMap<>(), ArrayList::new); /*************************************************************** ***************************************************************/ /*************************************************************** ***************************************************************/ /*************************************************************** ***************************************************************/ Collection<String> students = multimap.keySet(); /*************************************************************** ***************************************************************/ } }


上一篇:
下一篇:
切换中文