ONJava.com -- The Independent Source for Enterprise Java
oreilly.comSafari Books Online.Conferences.

advertisement

AddThis Social Bookmark Button
Article:
  10 Reasons We Need Java 3.0
Subject:   a bunch of amateur ideas...
Date:   2002-08-12 11:16:43
From:   jacyg
Response to: a bunch of amateur ideas...

mostly good, but clone() should not be a public method. See http://developer.java.sun.com/developer/bugParade/bugs/4673424.html
for a better solution. The reason clone() should not be public is that it you may not *want* to externally expose the ability to clone an object, and having a clone() that is protected allows you to accomplish this. My proposed solution still gives this ability when truly wanted, without sacrificing the ability to keep clone() restricted.