Re:JDK-4513622: keeping a substring of a field prevents GC f...
by masklinn on Sunday March 08, 2015 @03:44PM
(#9166910)
> substrings are mutable
Are you sure? I know that a byte slice []byte is mutable, but I thought slicing a string yielded a string (and strings are immutable), an explicit conversion (and copy) is needed to get the underlying byte slice.
Are you sure? I know that a byte slice []byte is mutable, but I thought slicing a string yielded a string (and strings are immutable), an explicit conversion (and copy) is needed to get the underlying byte slice.