java - Do we have pool of objects for wrapper classes too? -
i clarify few of queries. know wrapper classes final , immutable. have pool of objects string class did? , there mutable versions wrapper classes? string class has mutable versions stringbuilder , stringbuffer.
some wrapper classes (for example long , integer) have cache values (for integer , long, cache values between -128 , 127), behaves string pool, unlike string pool constant, adding new objects not possible.
as second question, i'm assuming it's typo , meant ask if wrapper classes have mutable versions string has stringbuilder. answer no.
Comments
Post a Comment