随笔分类 -  Javase

值传递和引用传递
摘要:先看一段代码,是我遇到过的一道面试的笔试题: 1 /** 2 * ***面试题 3 */ 4 public class StringBufferTest { 5 public static void main(String[] args) { 6 int i = 10; 7 test(i); 8 S 阅读全文

posted @ 2017-07-13 16:17 默默红尘 阅读(289) 评论(0) 推荐(0)

Integer中1000==1000为false而100==100为true
摘要:1 /** 2 * Created by hunt on 2017/6/3. 3 */ 4 public class TestInteger { 5 public static void main(String[] args) { 6 Integer i1 = 100, i2 = 100; 7 Sy 阅读全文

posted @ 2017-07-13 16:03 默默红尘 阅读(835) 评论(0) 推荐(0)

Apache的对象复制详解
摘要:BeanUtils.copyProperties 和 PropertyUtils.copyProperties 两个工具类都是对两个bean之前存在name相同的属性进行处理,无论是源bean或者目标bean多出的属性均不处理。 其原理是通过JDK自带的反射机制动态的去get,set,从而去转换我们 阅读全文

posted @ 2017-06-29 15:55 默默红尘 阅读(2151) 评论(0) 推荐(0)

对象属性复制几种方式的效率
摘要:对象属性复制的三种方法: 1.Apache提供的BeanUtil.copyProperties和PropertyUtil.copyProperties两种方式 BeanUtils.copyProperties("转换后的类", "要转换的类"); //多一步类型转换,比PropertyUtils效率 阅读全文

posted @ 2017-06-28 20:48 默默红尘 阅读(1601) 评论(0) 推荐(0)

导航