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 , have copyable, because cloneable has problems. besides fact it's misspelled, cloneable doesn't contain clone method. means can't test if instance of cloneable, cast cloneable, , invoke clone. have use reflection again, awful. 1 problem, 1 i'd solve.


Comments

Popular posts from this blog

python - No exponential form of the z-axis in matplotlib-3D-plots -

php - Best Light server (Linux + Web server + Database) for Raspberry Pi -

c# - "Newtonsoft.Json.JsonSerializationException unable to find constructor to use for types" error when deserializing class -