Is string a value type or a reference type?

Q

Is string a value type or a reference type?

✍: Guest

A

Answer1:
String is Reference Type.
Value type - bool, byte, chat, decimal, double, enum , float, int, long, sbyte, short,strut, uint, ulong, ushort
Value types are stored in the Stack
Reference type - class, delegate, interface, object, string
Reference types are stored in the Heap


Answer2:
Yes String is reference type. C# gives two types of variable reference and value type. string and object are reference type.

2014-02-27, 1665👍, 0💬