java与go实现String的区别
java中String定义:使用char[]即字符数组接收字符串
/** The value is used for character storage. */
private final char value[];//同时解释了String为什么是不可变的
go标准库builtin对string的定义:使用byte集合接收字符串,最重要的一点是conventionally but not necessarily representing UTF-8-encoded text(通常但并不一定是UTF-8编码的文本)
// string is the set of all strings of 8-bit bytes, conventionally but not
// necessarily representing UTF-8-encoded text. A string may be empty, but
// not nil. Values of string type are immutable.
type string string
在对比区别时先要了解一下位(bit)、字节(byte)、字符、编码
程序的内码(i