In C#, why is String a reference type that behaves like a value type?

后端 未结 12 2355
抹茶落季
抹茶落季 2020-11-22 02:04

A String is a reference type even though it has most of the characteristics of a value type such as being immutable and having == overloaded to compare the text rather than

12条回答
  •  醉酒成梦
    2020-11-22 02:40

    In a very simple words any value which has a definite size can be treated as a value type.

提交回复
热议问题