2013年3月26日

摘要: public static void main(String args[]) { Class c = null; Package p = null; Constructor constructors[]; Field fields[]; Method methods[]; int i,j; try{ c = Class.forName("java.net.URLDecoder"); /... 阅读全文
posted @ 2013-03-26 21:54 江在路上 阅读(144) 评论(0) 推荐(0) 编辑
 
摘要: Map是java中的接口,Map.Entry是Map的一个内部接口。 Map提供了一些常用方法,如keySet()、entrySet()等方法,keySet()方法返回值是Map中key值的集合;entrySet()的返回值也是返回一个Set集合,此集合的类型为Map.Entry。Map.Entry是Map声明的一个内部接口,此接口为泛型,定义为Entry<K,V>。它表示Map中的一个实体(一个key-value对)。接口中有getKey(),getValue方法。 由以上可以得出,遍历Map的常用方法: 1、通过entrySet,效率高,以后尽量使用这种方式 Map ma... 阅读全文
posted @ 2013-03-26 21:49 江在路上 阅读(209) 评论(0) 推荐(0) 编辑