摘要: 1 import org.junit.Test; 2 3 public class ArrReserve { 4 @Test 5 public void test() { 6 // String[] arr = {"1","2","3","4","5","6"}; 7 Integer[] arr = { 1, 2, 3 };//如果把Integer改成int,会编译失败,因为自定义泛型不能是基本数据类型?! 8 reserve(arr); 9 }10 11 public vo 阅读全文
posted @ 2014-04-08 19:56 一路向北中 阅读(157) 评论(0) 推荐(0)
摘要: 1 @Test 2 public void test(){ 3 Map myMap = new LinkedHashMap(); 4 myMap.put("s1", 1); 5 myMap.put("s2", 2); 6 myMap.put("s3", 3); 7 8 Set> entrySet = myMap.entrySet(); 9 for(Map.Entry e:entrySet){10 String key = e.getKey();11... 阅读全文
posted @ 2014-04-08 15:46 一路向北中 阅读(334) 评论(0) 推荐(0)
摘要: 略 阅读全文
posted @ 2014-04-08 13:22 一路向北中 阅读(190) 评论(0) 推荐(0)
摘要: 1 @Test2 public void testBean() throws ClassNotFoundException, Exception, IllegalAccessException{3 Class clazz = Class.forName("cn.linson.java.Person");4 Person bean = (Person) clazz.newInstance();5 String value = "xiaoqiang";6 BeanUtils.setProperty(bean, "name", ... 阅读全文
posted @ 2014-04-08 13:21 一路向北中 阅读(617) 评论(0) 推荐(0)
摘要: http://commons.apache.org/proper/commons-beanutils/download_beanutils.cgihttp://commons.apache.org/proper/commons-logging/download_logging.cgi 阅读全文
posted @ 2014-04-08 13:17 一路向北中 阅读(159) 评论(0) 推荐(0)
摘要: @Test public void testReflect() throws ClassNotFoundException, IllegalArgumentException, IllegalAccessException, InstantiationException { Class clazz = Class.forName("cn.linson.java.Person"); Person p = (Person) clazz.newInstance(); Field[] fileds = claz... 阅读全文
posted @ 2014-04-08 13:05 一路向北中 阅读(174) 评论(0) 推荐(0)