public static List removeDuplicateWithOrder(List list) {

Set set = new HashSet();

List newList = new ArrayList();

for (Iterator iter = list.iterator(); iter.hasNext();) {

Object element = iter.next();

if (set.add(element)){

newList.add(element);

}

}

return newList;

}

------

public static List removeDuplicateWithOrder(List list) {
Set set = new HashSet(list.size());
set.addAll(list);
List newList = new ArrayList(set.size());
newList.addAll(set);
return newList;
}

----

public static List removeDuplicateWithOrder(List list) { 
        List newList = new ArrayList(); 
        for (Object o : list) { 
            if (!newList .contains(o)) newList.add(o); 
        } 
        return newList; 
    }

最新文章

  1. 用字体在网页中画Icon图标
  2. 天书笔记:如何创建一个现代的footer(页脚)
  3. Spring3系列13-Controller和@RequestMapping
  4. Oracle性能优化--AUTOTRACE 操作
  5. 超级内存NVDIMM
  6. HTML页面背景音乐控制
  7. java单例模式使用及注意事项
  8. 《算法问题实战策略》-chaper15-计算几何-线段相交
  9. web文档类型DOCTYPE html很重要
  10. poj 1144 Network(割点)
  11. WinForm时间选择控件(DateTimePicker)如何选择(显示)时分秒
  12. flask请求上下文
  13. 【2016.3.16】作业 VS2015安装&单元测试(1)
  14. oracle-表空间剩余空间大小占比查询
  15. 在ASP.NET MVC中使用Knockout实践07,自定义验证信息的位置与内容
  16. vue项目中遇到的一些问题
  17. GitBook入门(用github做出第一本书)——超详细配图说明
  18. springBoot单元测试-基础单元测试
  19. js时间对比-转化为几天前,几小时前,几分钟前
  20. Windows模拟linux终端工具Cmder+Gow

热门文章

  1. 躁动不安的const
  2. CF 445B(DZY Loves Chemistry-求连通块)
  3. C#之out和ref区别
  4. BZOJ 3007 解救小云公主 二分答案+对偶图
  5. iOS----四方块 动画button实现
  6. PowerDesigner中导入MYSQL数据库结构的步骤及问题解决
  7. U4687 不无聊的序列
  8. bzoj3332: 旧试题
  9. JSTL判断list的size()大小,以及choose(相当于if else作用)
  10. 杂项-JSP-Runoob:JSP 标准标签库(JSTL)