Welcome to Questionaries, where you can ask questions and receive answers from other members of the community.

Let us know at info@questionaries.org

Is string a value type or a reference type?

3 like 0 dislike
Is Is string a value type or a reference type? ?
asked 1 year ago by marck_don (191,010 points)

1 Answer

1 like 0 dislike
 
Best answer
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

Yes String is reference type. C# gives two types of variable reference and value type. string and object are reference type.
answered 1 year ago by daneim (127,080 points)

Related questions

2 like 0 dislike
0 answers
2 like 0 dislike
1 answer
asked 1 year ago by marck_don (191,010 points)
2 like 0 dislike
1 answer
7 like 0 dislike
1 answer