Is string a value type or a reference type?

Answers were Sorted based on User's Feedback



Is string a value type or a reference type?..

Answer / rajkumar

Basically String is Value type But its Works(Behave) like
Reference Type...

Is This Answer Correct ?    1 Yes 9 No

Is string a value type or a reference type?..

Answer / chandrapal singh

string is value type by nature. it does not follow rules
of reference type. eg

string MyName1 = "chandrapal Singh";
string MyName2;

MyName2 = MyName1;
MyName2 = "deepak";

Response.Write("MyName1 :" + MyName1 + " MyName2 :" +
MyName2);

This gives Output
MyName1 :chandrapal Singh MyName2 :deepak

if this is reference type then the output should be
MyName1 :deepak MyName2 :deepak

Is This Answer Correct ?    7 Yes 29 No

Is string a value type or a reference type?..

Answer / raju

string is a value type...not reference type....we ll not
create an (instance) for that one...

Is This Answer Correct ?    7 Yes 62 No

Post New Answer

More ASP.NET Interview Questions

Explain the difference between asp.net mvc and asp.net webforms

0 Answers  


If you have to replicate a set of controls(UI) across a number of web pages, what will you do

1 Answers  


What does the "EnableViewState" property do? Why would I want it on or off?

2 Answers   Photon Infotech, Siebel Systems, Syntax Softtech,


Should user input data validation occur server-side or client-side? Why?

3 Answers   NIC, Siebel Systems,


What is the Custom Error in ASP.NET?

2 Answers   ABB, IBM, Infosys, Tech Mahindra,






Is overloading possible in web services?

3 Answers   Microsoft,


Using Statement usage in C#

2 Answers  


How you can add an event handler?

0 Answers  


How to use one project files into another project?

4 Answers   HP,


Where web.config file is used?

0 Answers   HCL,


What are sql joins?

0 Answers  


What is asp.net introduction?

0 Answers  


Categories