Is string a value type or a reference type?

Answer Posted / albn

String is a reference type. If two string variable has the
same string it stored in the same heap memory address.

eg in VB.Net
Dim a as string="Hello"
dim b as string="Hello"

both variable refer to same memory address. As strings are
immutable reference type you can't get the change in one
variable to another.

Is This Answer Correct ?    19 Yes 4 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What is difference Between Authentication and authorization?

780


What is IPostBack? How to use it?

823


What is Bundling and Minification in MVC?

757


What are app services?

716


What are the navigation ways between pages available in ASP.NET?

763






Can a master page have more than one contentplaceholder?

710


What is request and response in asp.net?

700


Where the viewstate is stored after the page postback?

847


How long should a session id be?

724


How do we assign page-specific attributes?

803


What is a web server? What are the load limits in it?

775


What are Master Pages in ASP.NET? or What is a Master Page?

806


What is a server farm in iis?

710


Who creates jsessionid?

775


What is enableviewstatemac in asp net?

763