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
What's the difference between a static method and a non static method c#?
Which of these statements correctly declares a two-dimensional array in c#?
What is a constructor in c#?
What are the advantages of properties in c#?
How many aware interfaces are there?
What is serialization in unity?
What is datagrid c#?
Explain what is an interface in c#?
What is the difference between Singleton design pattern and Factory design pattern?
What is a function c#?
What is namespace explain with example?
Is hashset ordered c#?
Does c# support multiple inheritance (mi)?
Define the term immutable ?
User's session is explicitly killed by which method ?