自定义深拷贝

public CAggregate clone()
{
      CAggregate newObj
= new CAggregate();
     
//newObj.list = this.list;
      newObj.list = new ArrayList();
     
for(int i = 0 ; i < this.list.length ; i++)
      {
          newObj.list[i]
= this.list[i];
      }
     
return newObj;
}

原文地址:https://www.cnblogs.com/linyijia/p/1952238.html