concreteprototype2.java
来自「Java设计模式(GOF)代码样例以及文档说明」· Java 代码 · 共 40 行
JAVA
40 行
/*
* 项目名称 Pattern
* 包名称 com.niufish.pattern.prototype
*
* 文件名称 ConcretePrototype1.java
*
*/
package com.niufish.pattern.prototype;
/**
* 具体的原始模型类2
* <p>
* <a href="ConcretePrototype2.java.html"><i>View Source</i></a>
* </p>
* @author Kingfish
* @version 1.0
*/
public class ConcretePrototype2 implements Cloneable {
private String _name;
public String getName() {
return _name;
}
public void setName(String type) {
this._name = type;
}
/**
* 克隆方法
* @see java.lang.Object#clone()
*/
public Object clone(){
ConcretePrototype2 temp = new ConcretePrototype2();
temp.setName(_name);
return (Object)temp;
}
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?