how to clone an object in android?

前端 未结 6 1707
醉梦人生
醉梦人生 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条回答
  •  [愿得一人]
    2021-01-07 19:14

    You have to specify on your class that it implements Cloneable interface and you have to override clone method inside that class. By Default it will use clone method of Object class.

提交回复
热议问题