6 ms·
Does this mean "" == ""?
by cr4zy 12y ago
Does this mean "" == ""?
- jontro 12y agoNo, string deduplication takes place in the internal String char array. Each String will still have it's own object.
- zackangelo 12y agoNot according to the article: > In fact the String Deduplication is almost like interning with the exception that interning reuses the whole String instance, not just the char array.
- chrisseaton 12y agoI think that might mean the opposite of what you think it does. Interning reuses whole String instances. Deduplication is like interning with the exception that it does not reuse the whole String instance, it just reuses the char array. Therefore surely deduplication does not reuse String instances.
- deleted 12y ago[deleted]
- aardvark179 12y agoNo, but that should be true anyway as they are string literals and automatically interned.