What is wrong with this clone()?

前端 未结 9 2029
梦如初夏
梦如初夏 2020-12-09 23:00

I have written this clone method for when the parent of the Employee class is abstract and the clone() method in the parent class is abstract.I wanted to copy the primitive

9条回答
  •  萌比男神i
    2020-12-09 23:29

    You should simply write

    return super.clone(); 
    

    in your clone method and implement the Clonable interface.

提交回复
热议问题