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 is a global postback url?

0 Answers  


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

0 Answers  


What is work flow gen? how can it will work with .Net?

0 Answers   TCS,


What is mvc in angular?

0 Answers  


You are using the try? catch block seen in the following code segment, but no exceptions are ever caught by the catch block. What is the problem? SqlConnection cn =new sqlConnection(strSQL); SqlDataSet ds; try { cn.open(); //perform the data processing steps ??.. } catch (OleDbException e) { ?.. } a) The exception class is wrong; it should be sqlErrors. b) The exception class is wrong; it should be sqlSyntaxExceptios. c) The exception class is wrong; it should be sqlExceptions. d) The exception class is wrong; it should be sqlExcptions.

2 Answers   Microsoft, Syntax Softtech,


What is loop in asp.net?

0 Answers  


How do you handle session management in ASP.NET and How do you implement them. How do you handle in case of SQLServer mode?

1 Answers   DELL, Microsoft,


A Web Service Can Only Be Written In .net. Is it True??

0 Answers   Siebel Systems,


Explain the disadvantages of viewstate?

0 Answers  


Explain Session state management options in ASP.NET.

0 Answers   CDC,


Explain how can we inherit a static variable?

0 Answers  


Which method is used to force all the validation controls to run?

0 Answers  


Categories