首页    管理页面    写新日志    退出


«July 2025»
12345
6789101112
13141516171819
20212223242526
2728293031


公告

Welcome to Lin's Space !

Just enjoy yourself .

Contact me:

jerry585@gmail.com


我的分类(专题)

日志更新

最新评论

留言板

我的相册

链接

Blog信息
blog名称:Lin's Space
日志总数:20
评论数量:99
留言数量:0
访问次数:240773
建立时间:2007年5月15日




[java]删除数组中重复元素比较简单的办法
软件技术

Great Void 发表于 2007/6/7 22:38:31

import java.util.*; public class RemoveDoubles {     public static void main(String[] args) {         // illustrating that a set filters doubles         ArrayList list = new ArrayList();         list.add("a");         list.add("a");         list.add("c");         System.out.println("list.size(): " + list.size());         System.out.println("list: " + list);         HashSet set = new HashSet(list);         System.out.println("set.size(): " + set.size());         System.out.println("set: " + set);         list = new ArrayList(set);         System.out.println("list: " + list);     }}


阅读全文(3072) | 回复(0) | 编辑 | 精华
 



发表评论:
昵称:
密码:
主页:
标题:
验证码:  (不区分大小写,请仔细填写,输错需重写评论内容!)



站点首页 | 联系我们 | 博客注册 | 博客登陆

Sponsored By W3CHINA
W3CHINA Blog 0.8 Processed in 0.031 second(s), page refreshed 144778873 times.
《全国人大常委会关于维护互联网安全的决定》  《计算机信息网络国际联网安全保护管理办法》
苏ICP备05006046号