hashmap
来源:互联网 发布:cardboard软件怎么使用 编辑:程序博客网 时间:2024/06/06 09:27
public class hashmap {
public static void main(String[] args) {
// TODO Auto-generated method stub
HashMap<String, ArrayList<Integer>>hash=new HashMap<String, ArrayList<Integer>>();
String key="aa";
ArrayList<Integer>bb=new ArrayList<>();
hash.put(key, bb);
hash.get(key).add(22);
hash.get(key).add(33);
System.out.println(hash);
}
}
输出结果为:
{aa=[22, 33]}
说明:hashmap的键值对中的值时不能重复的!!!
0 0
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- HashMap
- hashmap
- HashMap
- HashMap
- HashMap
- hashmap
- HashMap
- Hashmap
- HWOJ 字符串最后一个单词长度
- HD 1253 胜利大逃亡(bfs)
- iOS开发学习笔记——导航控制器1(UINavigationController)
- Its width is W and height is H. As a result, if the font size of characters is S then it can only sh
- 如何判断两个数字的奇偶性是否相同。
- hashmap
- CodeForces-659A-Round House
- hdu 3986 Harry Potter and the Final Battle 最短路spfa+枚举
- 《论文排版札记》part 2 作者简介、基金号、横线设置
- 文件服务器与web服务器分离的的
- 数据结构:栈
- 神经网络
- 【LeetCode】ZigZag Conversion 题解
- There is no getter for property named 'XXX' in 'class java.lang.String' 解决方案