Joe Soltzberg

22%
Flag icon
The major disadvantage of immutable classes is that they require a separate object for each distinct value.
Joe Soltzberg
Or more generally for each distinct set of values amongst all of its 'variable' fields. This could be used as a kind of 'upper memory bound' for immutable objects (depending on how many could/would be used and the distribution of the various values)
Brian
· Flag
Brian
y, would need to compute the worst case / probable case for memory consumption where combinatorics might blow up. but then again, what about String class? hard to be more wide open than that and it do…
Joe Soltzberg
· Flag
Joe Soltzberg
Very true. I think any kind of 'upper memory bound' like that would only really be useful as a theoretical concept
Effective Java
Rate this book
Clear rating
Open Preview