Key difference is that type of string literal is immutable(char)[] so it is perfectly legal to keep it in binary text segment. Type of array literal is just T[] (int[] here) and you can possibly mutate their elements. Because of this each assignment of array literal needs to allocate a new copy contrary to immutable strings which can all reference same memory chunk.

Reply via email to