参考copy链接:http://blog.csdn.net/bigconvience/article/details/25025561 在看原型模式,发现要用到clone这个方法,以前和朋友聊过,没怎么看过,刚好要用,就看看了. 源码解释: /** * Creates and returns a copy of this object. The precise meaning * of "copy" may depend on the class of the object. The…
Jackson对于date的反序列化只支持几种,如果不符合默认格式则会报一下错误 org.codehaus.jackson.map.JsonMappingException: Can not construct instance of java.util.Date from String value '2012-12-12 12:01:01': not a valid representation (error: Can not parse date "2012-12-12 12:01:01&q…
Service1.java package reflection; public class Service1 { public void doService1(){ System.out.println("业务方法1"); } } Service2.java package reflection; public class Service2 { public void doService2(){ System.out.println("业务方法1"); } } s…
Java常见对象Object类 public int hashCode() : 返回该对象的哈希码值. 注意:哈希值是根据哈希算法计算出来的一个值,这个值和地址值有关,但是不是实际地址值.你可以理解成地址值. package common_object; public class Demo extends Object{ } package common_object; public class DemoTest { public static void main(String[] args)…
4.JAVA基础语法:函数(方法).类和对象 函数 在java中函数也称为方法,是一段具备某种功能的可重用代码块. 一个函数包括这几部分: 函数头 函数头包括函数访问修饰符,函数返回值类型, 函数名,参数 代码块 返回值 具体看个实例: public class Main{ public static void main(String[] args){ int a = 1; int b = 2; int c = add(a, b); System.out.print(c); } public s…
[补充] [转] http://stackoverflow.com/questions/2603638/why-cant-this-simpledateformat-parse-this-date-string you'll need to supply a Locale.ENGLISH, else it won't work properly in machines with a different default locale. SimpleDateFormat sdf = new Simp…