Is string reference type / value type?

Answer Posted / baranee

Hi,

String is a value type but its not advisable to use for the
frequent usage of string.String is a class which has
default size of 16.If the value exceeds it will create one
more instance and left the old reference which is still not
cleared in memory. So we can use stringbuilder value type
which doubles the size when the default size exceeds.

Is This Answer Correct ?    1 Yes 3 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

Is string nullable in c#?

692


What is object type in c#?

730


What is the purpose of constructor in c#?

631


Is nullable type c#?

699


Does c# support try-catch-finally blocks?

653


What is .net console?

752


What is the difference between hashtable and dictionary?

730


What exactly is serverless?

605


What does void mean in c#?

714


Define multicast c# delegate?

738


What is difference between ilist and list?

681


What is generic and non generic collections in c#?

616


Is unboxing an implicit conversion?

728


What is the .net datatype that allows the retrieval of data by a unique key?

673


What is difference between method and function in c#?

667