当前位置:网站首页>多值映射:ArrayListMultimap和HashMultimap
多值映射:ArrayListMultimap和HashMultimap
2022-06-11 02:43:00 【zfoo-framework】
package org.example.testMultimap;
import com.google.common.collect.HashMultimap;
import com.google.common.collect.Multimap;
public class Main {
public static void main(String[] args) {
// {1=[1, 1]}
// Multimap<Integer, String> multimap = ArrayListMultimap.create();
// {1=[1]}
Multimap<Integer, String> multimap = HashMultimap.create();
multimap.put(1, "1");
multimap.put(1, "1");
System.out.println(multimap);
}
}
/*
// 总结: ArrayListMultimap HashMultimap都是多值映射, value都是一个数组,关键在于里面的元素是否能重复
*/边栏推荐
- @Controller @transactional @service annotation is invalid and less dependent
- Longest increasing subsequence
- Net core Tianma XingKong series - Interface Implementation for dependency injection and mutual conversion of database tables and C entity classes
- Helm deploy traifik ingress
- MySQL is required to sort in ascending order greater than or equal to the current time, and then in descending order less than the current time
- Correct posture of cocoscreator's native secondary development
- Array full permutation
- Three special data types, day3 and redis (geographic location, cardinality statistics and bitmap scene usage)
- Unity项目优化详解(持续补充ing)
- CPT 102_ LEC 17
猜你喜欢

Baidu submits sitemap to prompt the solution of "index type is not handled"

Arduino uno connected to jq8900-16p voice broadcast module

AOSP ~ modify WebView default implementation

Explication du cours de graphacademy: neo4j Graph Data Science Foundation

GraphAcademy 课程讲解:《Neo4j 图数据科学基础》

牛客网:数组中只出现一次的两个数字

新来的同事问我 where 1=1 是什么意思???

intXX_ T and int_ fastXX_ T what is the difference- What is the difference between intXX_ t and int_ fastXX_ t?

msg=SolrCore ‘collection1‘ is not available due to init failure: Could not l

B_QuRT_User_Guide(18)
随机推荐
Recent learning and update plan
【大咖秀】博睿数据眼中的AIOps,选择正确的赛道正确的人
org. apache. solr. common. SolrException:Could not load core configuration for core hotel
Young people fleeing big cities: shouldering housing prices and pressure, but not epidemics
. Net module and assembly - NET Module vs Assembly
Manon's advanced road - Daily anecdotes
DNS Optimization Practice of APP network optimization
位置数据融合表3
HOSATAPD_ CLI debug using WiFi whitelist
Rs232/rs485 to 4G DTU uploading temperature and humidity sensor data based on Modbus protocol to remote TCP server
Unity项目优化详解(持续补充ing)
Arduino uses nRF24L01 module for wireless communication
靠贴牌飞利浦冲击上市,德尔玛的自有品牌又该如何“起跳”?
[new open source project] dynamic configuration task scheduling framework gobrs async joins the dromara open source community
二叉树最小最低公共祖先
Question bank and answers for 2022 melting welding and thermal cutting operation certificate examination
Android WiFi hide SSID
One line of code solves the problem that the time to fetch datetime from MySQL database is less than eight hours
RS232/RS485转4G DTU 上传基于Modbus协议的温湿度传感器数据到远程TCP服务器
那些笑着离开“北上广”的人,为何最后都哭了?