how to clone an object in android?

前端 未结 6 1725
醉梦人生
醉梦人生 2021-01-07 18:43

What would be the best way to copy/clone an object in java/android?

rlBodyDataObj rlbo = bdoTable.get(name);

Right now the code assigns an

6条回答
  •  猫巷女王i
    2021-01-07 19:11

    class Test implements Cloneable
      {
       ...
          public Object clone()
          {
              try
          {
                  return super.clone();
              }
          catch( CloneNotSupportedException e )
          {
                  return null;
              }
          } 
      ...
      }
    

提交回复
热议问题