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 does the orientation property do in a menu control?

538


Which is better asp.net or php?

538


What are query strings used for?

536


Which data type does the rangevalidator control support?

560


What are the session variables?

518






Explain the different types of assemblies?

531


What is the difference between executescalar and executenonquery?

518


Explain how does asp page work?

578


Explain difference betn dataset and recordset?

534


What is the default timeout for a cookie?

564


Differentiate between globalization and localization.

541


What is difference between inproc and outproc?

666


If you have an application with multiple security levels though secure login and my ASP.NET web appplication is spanned across three web-servers by using round-robbin load balancing. Explain which is the best approach to maintain login-in state for the users?

608


What is clickid?

561


What are the different properties of server control that exists?

571