原型模式:通过克隆原型来创造新对象。 示例代码: package designpattern.prototype; public class Prototype implements Cloneable{ private String name; public String getName() { return name; } public void setName(String name) { this.name = name; } public Prototype(String name){ this.name = name; } public Prototype clone(){ Prototype p = null; try { p = (Prototype) super.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return p; } } //test case package designpattern.prototype; public class Test { public static void main(String[] args) { Prototype p = new Prototype("I am a prototype"); Prototype p1 = p.clone(); System.out.println(p1.getName()); } } 其实在java中原型模式其实就是Object.clone()的应用.