摘要: 一、Map的keySet方法可拿到Map中所有的key,返回值是Set类型,set有iterator方法可以拿到迭代器,再利用map.get(key)这个方法迭代出里面的内容。例如:import java.util.*;public class Test{public static void main(String args[]){Map<String,Integer> map=new HashMap<String,Integer>();map.put("一",12);map.put("二",13);map.put("三 阅读全文
posted @ 2013-03-08 22:48 stt_spring 阅读(152) 评论(0) 推荐(0) 编辑
摘要: import java.util.*;public class Test{ public static void main(String args[]){ List<Person> list=new ArrayList<Person>(); list.add(new Person("jack",21)); list.add(new Person("rose",18)); list.add(new Person("tom",19)); list.add(new Person("spring", 阅读全文
posted @ 2013-03-08 21:35 stt_spring 阅读(119) 评论(0) 推荐(0) 编辑
摘要: import java.util.*;public class Test{ public static void main(String args[]){ List<Person> list=new ArrayList<Person>(); list.add(new Person("jack",21)); list.add(new Person("rose",18)); list.add(new Person("tom",19)); list.add(new Person("spring", 阅读全文
posted @ 2013-03-08 20:35 stt_spring 阅读(239) 评论(0) 推荐(0) 编辑
摘要: public class Demo6{ public static void main(String args[]){ for(int i=0;i<100;i++){ System.out.println("----main----"+i); } Thread t1=new Thread(new T1()); t1.start(); }}class T1 implements Runnable{ public void run(){ for(int i=0;i<100;i++){ if(i==5){ try{ Thread.sleep(3000); }ca... 阅读全文
posted @ 2013-03-08 19:00 stt_spring 阅读(142) 评论(0) 推荐(0) 编辑