Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Why strings are of reference type in C#.NET?

a) To create string on stack
b) To reduce the size of string
c) To overcome problem of stackoverflow
d) None of the mentioned

Answer: b
Explanation: The problem of stack overflow very likely to occur since transport protocol used on web these days are ‘HTTP’ and data standard as ‘XML’. Hence, both make use of strings extensively which will result in stack overflow problem. So, to avoid this situation it is good idea to make strings a reference type and hence create it on heap.

Join The Discussion