设计模式

This commit is contained in:
luoxiang
2019-12-08 19:48:21 +08:00
parent 0aeefd7e05
commit db174f1624
12 changed files with 863 additions and 5 deletions

View File

@ -22,6 +22,7 @@ public class SmartPhone implements Cloneable {
@Override
protected Object clone() throws CloneNotSupportedException {
SmartPhone smartPhone = (SmartPhone) super.clone();
// 对引用对象进行拷贝
smartPhone.productionDate = (Date) smartPhone.productionDate.clone();
return smartPhone;
}