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
Ïà¹ØÎĵµ£º
ListµÄÓ÷¨
List°üÀ¨List½Ó¿ÚÒÔ¼°List½Ó¿ÚµÄËùÓÐʵÏÖÀà¡£ÒòΪList½Ó¿ÚʵÏÖÁËCollection½Ó¿Ú£¬ËùÒÔList½Ó¿ÚÓµÓÐCollection½Ó¿ÚÌṩµÄËùÓг£Ó÷½·¨£¬ÓÖÒòΪListÊÇÁбíÀàÐÍ£¬ËùÒÔList½Ó¿Ú»¹ÌṩÁËһЩÊʺÏÓÚ×ÔÉíµÄ³£Ó÷½·¨£¬Èç±í1Ëùʾ¡£
±í1 List½Ó¿Ú¶¨ÒåµÄ³£Ó÷½·¨¼°¹¦ÄÜ
´Ó±í1¿ÉÒÔ¿´³ö£¬List½Ó¿ÚÌṩµÄÊʺÏÓÚ×ÔÉíµÄ ......
ÔÎÄÁ´½Ó£ºhttp://badwing.javaeye.com/blog/674263
ÎÄÕ·ÖÀà:Java±à³Ì
ºÃ¶àÅóÓÑÓùýWindowsµÄÈÎÎñ¼Æ»®£¬Ò²Óв»ÉÙ³ÌÐòÃÔ×Ô¼ºÔøÐ´¹ýʱÖÓ±¨¾¯¡¢ÏµÍ³×Ô¶¯¹Ø»úµÈȤζ³ÌÐò£¬¿ÉÈ´ºÜÉÙÓÐÅóÓÑÔÚWeb¹¤³ÌÖÐʵÏÖ¹ýÀàËÆ¹¦ÄÜ¡£
µ±Web¹¤³ÌÆô¶¯Ê±£¬¶¨Ê±Æ÷ÄÜ×Ô¶¯¿ªÊ¼¼ÆÊ±£¬ÔÚÕû¸öWeb¹¤³ÌµÄÉúÃüÆÚÀ¶¨Ê±Æ÷ÄÜÔÚÿÍíÉîÒ¹´¥·¢Ò»´ÎÈ ......
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 ......
1¡¢±ØÐëÒýÈ룺java.text.SimpleDateFormat
2¡¢ÉèÖÃÏÔʾ·½Ê½£¬µ÷ÓÃformat¸ñʽ¡£
SimpleDateFormat sdf=new SimpleDateFormat("yyyyÄêMMÔÂddÈÕ");
String date=sdf.format(blog.getCreatedTime());
sdf=new Simp ......