clone - Java: Rationale of the Cloneable interface -
why wasn't .clone()
method specified in java.lang.cloneable
interface ?
basically, it's broken interface. ken arnold , bill venners discussed in java design issues.
arnold:
if god @ point, , many people glad not, deprecate
cloneable
, havecopyable
, becausecloneable
has problems. besides fact it's misspelled,cloneable
doesn't containclone
method. means can't test if instance ofcloneable
, castcloneable
, , invokeclone
. have use reflection again, awful. 1 problem, 1 i'd solve.
Comments
Post a Comment