1.implements Cloneable
2.
1 public PortfolioInstrumentMetric clone() { 2 PortfolioInstrumentMetric o = null; 3 try { 4 o = (PortfolioInstrumentMetric) super.clone(); 5 } catch (CloneNotSupportedException e) { 6 e.printStackTrace(); 7 } 8 return o; 9 }
实现接口方法,另外Object clone分为浅克隆和深克隆,后续在写。
时间: 2024-10-16 12:24:38