摘要: HashMap hsMap=new HashMap hsMap.put("1","value") Set set=hsMap.keySet();//获取键值 Iterator it=set.iterator(); while(it.hasNext()){ String str=it.next(); } Collection coll=hsMap.values();//获取数值... 阅读全文
posted @ 2016-08-10 11:30 奔跑丶小清新 阅读(247) 评论(0) 推荐(0)
摘要: iterator 迭代器 hasNext 判断是否还有下一个元素 next获取每一个元素 循环输出 最好使用while() 例如: 阅读全文
posted @ 2016-08-10 10:42 奔跑丶小清新 阅读(107) 评论(0) 推荐(0)
摘要: HashSet:数据进行hashCode比较,然后进行equals方法比较,根据比较结果进行排序。如果要对对象进行排序,对象类要重写hashCode和equals方法。TreeSet:如果要对对象进行排序,对象类要实现Comparable接口!HashMap:如果要对对象进行排序,对象类要重写has 阅读全文
posted @ 2016-08-10 08:59 奔跑丶小清新 阅读(158) 评论(0) 推荐(0)