1.List<Integer> list=new ArrayList<Integer>();  //有值

List<Integer> listTemp= new ArrayList<Integer>();  //临时的list

Iterator<Integer> it=list.iterator();//取得有值得list的迭代器

while(it.hasNext()){

  int a  = it.next();

  if(listTemp.contains(a)){

    it.remove();

  }else{

    listTemp.add(a);

  }

}

2直接赋值

List<Integer> list=new ArrayList<Integer>();  //有值得

list  List<Integer> tempList= new ArrayList<Integer>();

for(Integer i:list){

  if(!tempList.contains(i)){

     tempList.add(i);

}

}

最新文章

  1. Window7下安装Ubuntu 14.04 64bit
  2. png图片尺寸大小调整
  3. mysql计划任务
  4. Java NIO流 -- 缓冲区(Buffer,ByteBuffer)
  5. [转载]浅析STL allocator
  6. DEDECMS栏目自定义字段添加
  7. Python随机数与随机字符串详解
  8. BGP
  9. 使用SQL Server 2000索引视图提高性能
  10. mysql 时间戳格式化函数FROM_UNIXTIME和UNIX_TIMESTAMP函数的使用说明
  11. angularJS的插件使用
  12. Python 简单入门指北(一)
  13. spoon 更新数据
  14. Video.js 简单的使用介绍
  15. Codeforces Round #280 (Div. 2) E. Vanya and Field 思维题
  16. [tools]python的mkdocs模块分分钟将md搞成一个网站
  17. BZOJ2694 Lcm 【莫比乌斯反演】
  18. CaptureMouse/CaptureStylus 可能会失败
  19. c++ 网络编程(二) linux 下多进程socket通信 多个客户端与单个服务端交互代码实现回声服务器
  20. redis复制+Sentinel搭建

热门文章

  1. centos6.8 docker0: iptables: No chain/target/match by that name
  2. vb代码之-------当窗体BorderStyle属性为0时,添加窗口预览到任务栏
  3. Java中的集合框架(中)
  4. spring mvc的跨域解决方案
  5. ajax---&gt;简单加法小练习
  6. React问题集序
  7. CTF---Web入门第八题 Guess Next Session
  8. Codility:Titanium 2016 challenge:BracketsRotation
  9. 我的第五个网页制作:pre、html转义、abbr标签的使用
  10. Vijos P1127 级数求和【模拟】