It is a bad idea to make an immutable object Cloneable
. This is why String
is not Cloneable. Immutable BigInteger
and BigDecimal
are also not Cloneable
.
But mutable StringBuilder and StringBuffer cannot be cloned!
What is the reason behind that desicion?
Yes, I can use "copy constructor" new StringBuilder(CharSequence seq)
but what is the design principle/reasoning to supply a copy constructor and prohibit cloning?