I was studying effective java and In immutability(Item 15) it is written that: Make defensive copies (Item 39) in constructors, accessors, and readObject methods (Item 76).
And In Item 76 It is advised to override readObject and create a defensive copy of the mutable object by compromising final keyword. So i checked the String class in java and check whether they have done the same for final char value[]; but readObject is not overridden.
I am confused about this ? Please if answer.
from Newest questions tagged java - Stack Overflow http://ift.tt/1LytnmY
via IFTTT
Aucun commentaire:
Enregistrer un commentaire