@Data
public class TestData implements Cloneable {
private String date1;
private String date2;
public Object clone() {
BillAnalysis o = null;
try {
o = (BillAnalysis) super.clone();
} catch (CloneNotSupportedException e) {
e.printStackTrace();
}
return o;
}
}
1.接口
implements Cloneable
2.重写clone方法
public Object clone() { BillAnalysis o = null; try { o = (BillAnalysis) super.clone(); } catch (CloneNotSupportedException e) { e.printStackTrace(); } return o; }