java HashSet去重示例
import java.util.ArrayList;
import java.util.HashSet;
import java.util.Iterator;
import java.util.List;
public class HashSetDemo {
public static void main(String[] args){
List tableList = new ArrayList();
tableList.add("hello");
tableList.add("hell0");
tableList.add("world");
tableList.add("world");
tableList.add(2);
tableList.add(2);
tableList.add(true);
tableList.add(true);
HashSet hs = new HashSet(tableList);
//System.out.println(hs.toString());
//System.out.println(tableList);
Iterator i = hs.iterator();
while(i.hasNext()){
Object temp = i.next();
System.out.println(temp.toString());
}
}
}
输出:
2
true
hell0
hello
world
相关文档:
2008 年 6 月 24 日
原文地址: http://www.ibm.com/developerworks/cn/data/library/techarticles/dm-0806wangys/
本文介绍 IBM FileNet P8 4.0 Platform 提供的 Content Java API。首先对 FileNet P8 Content Engine 和 API 进行概要介绍, 并说明了一些基本概念,随后详细介绍了 FileNet Content Engine提供的基于 EJB ......
1.j2ee
http://0444.xue8xue8.com/computer/program/java/j2eeshuren/00.wmv
http://0444.xue8xue8.com/computer/program/java/j2eeshuren/01.wmv
http://0444.xue8xue8.com/computer/program/java/j2eeshuren/02.wmv
http://0444.xue8xue8.com/computer/program/java/j2eeshuren/03.wmv
http://0444.xue8xue8.com/c ......
昨天看到一个题目:java异常机制和垃圾处理机制,发现平时用的时候也没太注意,拿过来就用。学习这东西就得不断总结、积累,不然时间长还谁还记得它长啥样。
java异常基本概念就不用说了,
java异常主要分为三类:
1)编译时异常java.lang.Exception
2)运行时异常 java.lang.RuntimeException
&nb ......
摘至Sybase官网:
The caller( ) method calls the stored procedure inoutproc:
create proc inoutproc @id int, @newname varchar(50), @newhome Address,
@oldname varchar(50) output, @oldhome Address output as
select @oldname = name, @oldhome = home from xmp where id=@id
update xmp set name ......
下面参考别人的文章和自己的一点改动和总结并加以注释
JAVA反射机制主要提供了以下功能:
1.在运行时判断任意一个对象所属的类。
2.在运行时构造任意一个类的对象。
3.在运行时判断任意一个类所具有的成员变量和 ......