Hi All,
can anyone explain me this stanza mentioned in Effective Java 2nd Edition
Kindly help.
Thanks
can anyone explain me this stanza mentioned in Effective Java 2nd Edition
Not only can you share immutable objects, but you can share their internals.
For example, the BigInteger class uses a sign-magnitude representation
internally. The sign is represented by an int, and the magnitude is represented by
an int array. The negate method produces a new BigInteger of like magnitude
and opposite sign. It does not need to copy the array; the newly created BigInteger
points to the same internal array as the original.
Kindly help.
Thanks