[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: the benefits of immutability

Alexander Schmolck <a.schmolck@gmx.net> writes:
> "Perry E. Metzger" <perry@piermont.com> writes:
> > Frankly, I don't see how anything follows from your comments. I made a
> > point that it was annoying that String couldn't be subclassed, first
> > you claimed (bizarrely) that this was so that String could be
> > immutable (which of course the final StringBuffer type disproves)
> No, it doesn't (Hint: "necessary" != "sufficient").

*All* of Java's base object types are final -- String, StringBuffer,
 Boolean, Integer, etc., and the vast majority of those are mutable.

His explanation was pretty damn weak in that context.

Perry E. Metzger		perry@piermont.com