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

What are the various types of validation controls provided by asp.net?

0 Answers  


Explain Page life cycle

8 Answers   DELL,


What are the difference between function and stored procedure in .net programming language?

0 Answers  


how to write code for role based security

2 Answers  


What are strong names?

0 Answers  






What is the server of asp.net?

0 Answers  


Where code pages are used?

0 Answers   Blue Star,


How do you deploy your asp.net application?

0 Answers  


Tell something about state management in asp.net?

3 Answers   Accenture,


What is slidemaster?

0 Answers  


What is the difference between Server.Transfer and Response.Redirect? Why would I choose one over the other?

3 Answers   Satyam,


Which is the parent class of the ASP.NET server control?

0 Answers   Sans Pareil IT Services,


Categories