HashSet
来源:互联网 发布:mac进入恢复模式 编辑:程序博客网 时间:2024/05/17 07:18
package com.jzm.collections;
import java.util.HashSet;
public class HashSetDemo {
public static void main(String[] args) {
// TODO Auto-generated method stub
HashSet hSet = new HashSet();
hSet.add("a");
hSet.add("c");
hSet.add("b");
hSet.add("d");
System.out.println(hSet);
}
}
输出结果:
[d, b, c, a]
说明HashSet的存储是没有顺序的 如果需要顺序 可以用TreeSet
- HashSet
- Hashset
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- HashSet
- hashset
- HashSet
- Richard Stevens答读者问
- ArrayList
- Building MySQLdb for Python on Windows
- HTML5游戏实战之俄罗斯方块
- 16进制转成RGB
- HashSet
- 利用字符实现大数除法运算(纯c实现)
- 代码疑云(10)-浅谈联合体
- C#判断操作系统是32位还是64位
- DB2锁的理解
- 快速掌握查看数据库表死锁的实用方法
- TreeSet
- php 父类调用子类方法
- 页面包含文件