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 is func c#?
Can a struct have a default constructor (a constructor without parameters) or a destructor in c#?
What are the return types in c#?
What is a dimensional array?
What is the difference between ref and out parameters in c#?
How can we set the class to be inherited, but prevent the method from being over-ridden?
What is Fragmentation and its Types?
what is a structure in c#
Asha buys 16 Chocolates for rs 12 and 24 chocolates for rs 20, if she sold them 30 chocolates for rs 30 then what is the Gain/Loss percentage? Gain(700/19 %) Loss(700/19 %) Gain(500/19 %) Loss(500/19 %) If one person ate 100 grapes in 5 days and 6 more each day from starting, what was the no of grapes he ate on first day? 6 8 10 7 If seven men P, Q, R, S, T, U, V parked his car, P and Q something like that. 6 student J, K, L, M, N, O went for picnic in 2 batches, K and L have to go together, M and O do't go together, if O and L go in one batch then which of these combination will be wrong. Jmnp Jklo klop JKLO a boat can go upstream and down stream, if it goes 5/2 times of downstream at the speed of 6 kmph then what will be the speed of upstream? 15 KMPH 12 KMPH 10 KMPH 11 KMPH A, B, C, D, E sitting on a table, A sits 2 seat left from B and C sits 2 seat right from B then what will not be the combination ACDE
Can I fly with a loop recorder?
What is the difference between firstordefault and singleordefault?
List the difference between the virtual method and the abstract method?
Give an example of removing an element from the queue?
What are the types of comment in c# with examples?
What is the difference between yield and return?