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 c# the same as d flat?

722


What is datetime minvalue in c#?

789


Can we overload the main method in c#?

698


What is a datacontract?

682


What is .edmx file?

727


What is a void c#?

689


What is asynchronous one-way calls?

762


What is the difference between continue and break statement?

777


What are class fields?

715


State two different types of access modifiers.

779


What is use of private class in c#?

759


Why are strings immutable c#?

667


What is c# in asp net?

693


Is collection a data structure?

748


What is the benefit of dependency injection c#?

689