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

What is the reason behind the invention of c#?

635


Explain the difference between event and a delegate in c#?

534


Why singleton class is sealed?

482


In gridview in editmode if we want to display information in one combobox based on

1824


What is difference between array and arraylist in c#?

449






Is comparator a functional interface?

465


What is method overriding in c#

598


Is it possible to inline assembly or il in c# code?

528


What are the examples of data types?

488


What is cts, clr?

435


What are Uses of CLR

535


What is dynamic object in c#?

529


Explain what is the smallest unit of execution in .net?

480


What are extender provider components?

475


Explain deadlock?

517