What is the use of cloneable interface in java?

后端 未结 5 564
别那么骄傲
别那么骄傲 2020-12-02 00:33

What is the use of implementing a cloneable interface as it is a marker interface?

I can always make a public Object clone() method in my class. What is the actual p

5条回答
  •  抹茶落季
    2020-12-02 01:15

    Some people say it's an attempt to mimic copy constructor from C++, but here's the previous similar question on StackOverflow about it: About Java cloneable

提交回复
热议问题