随笔分类 -  设计模式

摘要:话题引入: 对象的创建和生成 在我们需要创建一个对象时,可以通过各种方式。 最直接的方式莫过于new 了。另外也可以通过Class对象的newInstance(),以及 Constructor.newInstance(Class ... args);进行创建。 1 public class ClassName{ 2 // The defintions of this class goes there. 3 } 4 5 // 通过new 创建 6 ClassName instance = new ClassName(); 7 8 9 // 通过newInstance创建10 C... 阅读全文
posted @ 2014-02-09 23:52 Luan Louis 阅读(253) 评论(0) 推荐(0)