Cloneable and Immutable

Max (Weijun) Wang Weijun.Wang at Sun.COM
Wed Aug 19 22:08:07 PDT 2009


Oh, no. Object.clone() is protected.

On Aug 20, 2009, at 12:57 PM, Max (Weijun) Wang wrote:

> Hi
>
> I'm refactoring an existing Cloneable class to make it immutable. It  
> seems I can simply remove the clone() method and let Object.clone()  
> take care it. Also, if it's a final class, is it better to simply  
> return this?
>
> Thanks
> Max



More information about the jdk7-dev mailing list